Skip to content

Desktop loses access to existing sessions after profile reset; opencode.db still contains sessions/messages but Desktop & Web show no history #34471

Closed as not planned

Description

@Codeagle04

Description

Summary

I encountered two related issues on macOS using OpenCode Desktop 1.17.11.

  1. Desktop started returning "Interrupted" for every prompt.
  2. After fixing that issue by resetting the Desktop profile, all previous chat history disappeared from both Desktop and Web, even though the conversations still exist in opencode.db.

Environment

  • OpenCode Desktop: 1.17.11

  • Operating System: macOS

  • Provider: OpenCode

  • Models tested:

    • Big Pickle
    • DeepSeek V4 Flash Free
    • GLM Free

The problem occurs with all models.


Problem 1 – PTY failure

Every prompt immediately returned:

Interrupted

Developer Console showed:

PUT http://127.0.0.1/:/pty/... → HTTP 503 (Service Unavailable)

Resetting the Desktop profile by renaming:

~/Library/Application Support/ai.opencode.desktop

resolved the PTY issue.


Problem 2 – Existing sessions disappear

After the profile reset, Desktop started working again, but all previous sessions disappeared.

opencode web also shows no previous sessions.

However, the database is still intact.

Database:

~/.local/share/opencode/opencode.db

Contents:

  • session = 5 rows
  • message = 176 rows
  • part = 455 rows

Example SQL:

SELECT COUNT(*) FROM session;
-- 5

SELECT COUNT(*) FROM message;
-- 176

SELECT COUNT(*) FROM part;
-- 455

The message.data column still contains valid JSON for both user and assistant messages.

Example:

SELECT substr(data,1,300)
FROM message
LIMIT 5;

returns valid conversation data.


Database observations

The session table contains:

SELECT id,title,workspace_id,project_id,directory
FROM session;

Result:

  • workspace_id = NULL for every session
  • project_id = global

The workspace table contains zero rows:

SELECT * FROM workspace;

returns no records.


Expected behavior

Desktop/Web should display the existing sessions already stored in opencode.db.


Actual behavior

The database still contains sessions, messages, and parts, but Desktop and Web display no history.


Additional observations

This is not the first time I have experienced disappearing sessions.

Over multiple versions I have noticed that:

  • Desktop often asks me to select/open a project again after restart.
  • Existing sessions sometimes disappear.
  • Conversations appear to be saved in the database but are not rediscovered by the UI.

This makes long-running conversations unreliable.


Questions

  1. Should workspace contain records for existing sessions?
  2. Is workspace_id = NULL expected for migrated sessions?
  3. Is there an official procedure to rebuild the workspace/session index without losing history?
  4. Is there a migration that can repopulate the workspace table from existing sessions?

I would be happy to provide additional logs or test a fix if needed.

Image

Plugins

No Plugins enabled

OpenCode version

Version 1.17.11 (1.17.11)

Steps to reproduce

  1. Open OpenCode Desktop 1.17.11 on macOS.
  2. Open an existing project.
  3. Use OpenCode normally across multiple sessions and restarts.
  4. After some period of usage, prompts begin immediately returning "Interrupted".
  5. Developer Console shows HTTP 503 errors for /pty/....
  6. Renaming ~/Library/Application Support/ai.opencode.desktop restores PTY functionality.
  7. After the reset, Desktop no longer shows previous chat history.
  8. opencode web also shows no previous sessions.
  9. However, ~/.local/share/opencode/opencode.db still contains all sessions, messages and parts.

Screenshot and/or share link

No response

Operating System

macOS

Terminal

macOS Terminal and Opencode Desktop Terminal

Activity

  1. github-actions commented on Jun 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. Codeagle04 commented on Jun 29, 2026

    @Codeagle04
    Author

    Thanks for linking the related issues.

    After reviewing the linked issues and performing additional
    investigation on my installation, I believe my case belongs to the same
    family of issues. However, I was able to gather some additional
    diagnostics that may help identify the root cause.

    Database state

    The session database is intact.

    SELECT COUNT() FROM session; -- 5
    SELECT COUNT(
    ) FROM message; -- 176
    SELECT COUNT(*) FROM part; -- 455

    The message.data column still contains valid JSON for both user and
    assistant messages, confirming that the conversation content itself has
    not been lost.

    Example:

    SELECT substr(data,1,300)
    FROM message
    LIMIT 5;

    returns valid user and assistant message JSON.

    Session metadata

    All sessions have:

    project_id = 'global'
    workspace_id = NULL

    Example:

    SELECT id, title, workspace_id, project_id, directory
    FROM session;

    returns five valid sessions, all with workspace_id = NULL.

    Workspace table

    The workspace table is completely empty.

    SELECT * FROM workspace;

    returns zero rows.

    UI behaviour

    Neither OpenCode Desktop nor opencode web can see any of these
    sessions, even though they are still present in
    ~/.local/share/opencode/opencode.db.

    PTY issue

    I also encountered an apparently separate PTY issue where every prompt
    immediately returned "Interrupted", and the Developer Console showed
    HTTP 503 errors for /pty/....

    Resetting the Desktop profile by renaming:

    ~/Library/Application Support/ai.opencode.desktop

    resolved the PTY issue, but it did not restore visibility of the
    existing sessions.

    Additional observation

    This is not the first time I have experienced disappearing sessions.
    Over multiple versions I have noticed that:

    Desktop frequently asks me to re-open or select a project after
    restarting.
    Existing sessions sometimes disappear.
    The underlying SQLite database continues to contain the
    conversations, but neither Desktop nor Web is able to rediscover
    them.

    Questions

    Would it help if I provided any of the following?

    Additional SQL query results
    SQLite schema
    Database (privately, if required)
    Application logs
    A copy of opencode.db after removing sensitive information
    Results from testing a development/nightly build

    I'm happy to help test fixes or run additional diagnostics if they would
    assist in identifying the root cause.

  3. github-actions commented on Aug 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions