Skip to content

Session lost #21156

Closed
Closed

Description

@lckksk

Description

Today, when I opened OpenCode, all the sessions for the projects with active lines were gone.

Plugins

superpowers and context7

OpenCode version

Previously I was using version 1.3.13, today it opened as version 1.3.15

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

ubuntu22.04

Terminal

TUI in WSL

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 6, 2026
  2. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

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

    If your issue is different from the above, please add more details about what you were doing before the sessions disappeared (e.g., did OpenCode auto-update from 1.3.13 to 1.3.15 while open, or did you manually update and restart?).

  3. lckksk commented on Apr 6, 2026

    @lckksk
    Author

    The first time I opened it today, it was version 1.3.15. When I entered the project directory and started OpenCode, I found that none of the sessions were displayed. After switching projects, I found that the sessions of other projects had also disappeared. I am used to having one session per task, which ensures that each of my sessions has not used too many tokens and has not used /compact. Now it is already version 1.3.16, but the sessions still do not appear.

  4. lckksk commented on Apr 6, 2026

    @lckksk
    Author

    Just now, when I reopened it, the session was restored, but correspondingly, the new conversations I created during the period when the session was lost were gone.

  5. aaam commented on Apr 6, 2026

    @aaam

    @lckksk I changed working directory and it listed different sessions than from the one I worked before.

    When you use a never activated folder, where no new session has ever been created from, the session list shows all your sessions and they are alive, stored in ~/.local/share/opencode/storage/session/ .
    When you have too many sessions that can use a loads of resources

    As it looks to me only the session history is truncated by each project's working directory.

    If you need to get all your sessions list, cd to /tmp and run
    npx opencode-ai@1.3.15 session list --max-count 5000 --format table

    Also the git workspace alters the session's list because the path is appended by :ref .

  6. lckksk commented on Apr 7, 2026

    @lckksk
    Author

    @aaam I created a new folder and used npx opencode-ai@1.3.17 session list --max-count 5000. Strangely, it only displayed some of the session records.

  7. lckksk commented on Apr 9, 2026

    @lckksk
    Author

    最新消息,我有两个项目,这次更新到1.4.1之后使用/session指令,发现项目一会话全部丢失,项目二会话只剩一个。

    Image Image
  8. lckksk commented on Apr 9, 2026

    @lckksk
    Author

    找到原因,是我个人操作导致的问题,我的工作目录中有大写字母G,但是在wsl中使用小写字母g同样能进入目录,这让我以为目录是不区分大小写的,导致有时会进入g目录,在这个目录中没有会话记录,让我误以为丢失。虽然wsl不区分大小写但存储会话记录的oepncode数据库是区分大小写的,现在G、g目录都有会话记录,我已经修改数据库中的g路径为G。

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions