You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
migration: v1 sessions imported into "global" project, hidden from TUI session lists #55069
After upgrading from V1 to V2, all migrated V1 sessions were assigned to the synthetic global project (worktree /) instead of the project for each session's original
directory. Because the V2 TUI session list is scoped to the current project, a user's
entire session history appears lost after the upgrade. The data itself is intact — only
the session→project association is wrong.
Environment
opencode version: v2.0.27 (upgraded from V1 via curl installer, latest channel)
OS: Linux (x64)
Active plugins: none
Reproduction
On V1, create sessions in several working directories (e.g. ~/project-a, ~/project-b, ~/project-c).
Upgrade to V2. On first run, V2 migrates V1 storage into ~/.local/share/opencode/opencode.db.
Launch the V2 TUI in one of those original session directories.
Open the session list: only newly created sessions appear; all migrated sessions are
missing.
Confirm via the API/DB:
GET /api/session?project=global → returns every migrated session, all with project_id = 'global', even though their directory values point to the original
paths.
GET /api/session?project=<project id> for the current directory → returns only
sessions created after that project registered itself (which happens on the first
launch after the upgrade).
Expected Behavior
Migrated V1 sessions should be associated with the project for their original directory
(or that project should be created during migration), so they appear in that directory's
TUI session list.
Actual Behavior
All migrated sessions — and any session created in a directory before its project was
registered — are attached to the catch-all global project (worktree /). They are
invisible to per-directory project session lists, making session history look completely
lost after the V1→V2 upgrade.
Additional Context
Message/part data migrated correctly; sessions are not archived (time_archived is
null for all).
Workaround: reassigning sessions with POST /api/session/{id}/move
({"directory": "..."}) restores visibility, but it permanently changes each session's
working directory as a side effect.
Thanks for the detailed report! I think this is a duplicate of #50999, which describes the same problem: after the v1→v2 import, migrated sessions keep project_id = 'global' even though their directory is correct, so they don't show up in the per-directory session list.
Possible duplicates and closely related issues, ordered by likelihood:
We haven't heard back in the past day, so I'm closing this as a duplicate of #50999. That issue covers the same problem: migrated v1 sessions keep project_id = 'global' and are hidden from per-directory session lists. You can follow progress there and in #49827. Open PR #51935 targets the same cause by assigning migrated sessions to the project for their original directory. If your case turns out to be different, please comment here or open a new issue with the details. Thanks for the clear report!
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed report! I think this is a duplicate of #50999, which describes the same problem: after the v1→v2 import, migrated sessions keep
project_id = 'global'even though theirdirectoryis correct, so they don't show up in the per-directory session list.Possible duplicates and closely related issues, ordered by likelihood:
globalproject and is hidden from project session lists.session moveworkaround and its side effect.project_idwithout resolving the project from the session'sdirectory.globalsessions to the project for their own directory.If any of your data adds something new (for example, git-project sessions also ending up under
global), please add it to #49827 or #50999.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
opencode-agent commentedon Oct 14, 2026
We haven't heard back in the past day, so I'm closing this as a duplicate of #50999. That issue covers the same problem: migrated v1 sessions keep
project_id = 'global'and are hidden from per-directory session lists. You can follow progress there and in #49827. Open PR #51935 targets the same cause by assigning migrated sessions to the project for their original directory. If your case turns out to be different, please comment here or open a new issue with the details. Thanks for the clear report!