Skip to content

Active sessions can be lost after a hard power-off before they appear in session list #35505

Description

@Bilalmd01

Description

I lost several active OpenCode sessions after my laptop froze and I had to perform a hard power-off.

After rebooting:

  • opencode session list did not show any of the active sessions.
  • The conversations appear to be unrecoverable.

This seems like OpenCode may not be persisting session state frequently enough, causing complete loss of active conversations after an unexpected shutdown.

The missing sessions are not present in the session table, and there are no corresponding rows in the message or session_message tables.

The database itself appears healthy.

The log only contains process startup messages for the lost instances and never logs a session.id, suggesting the sessions may never have been committed before the crash.

Plugins

No response

OpenCode version

1.17.13

Steps to reproduce

  1. Start an OpenCode session with opencode:

  2. Work in the sessions for a while.

  3. Simulate an unexpected shutdown (kernel panic / hard power-off).

  4. Reboot.

  5. Run:

    opencode session list

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04.4 LTS

Terminal

Bash

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions