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
Migrated non-git sessions stay under project_id 'global', so the V2 TUI shows 0 sessions while the desktop app lists them #56760
After upgrading to V2, the history migration ran and copied ~5,241 sessions, but sessions from non-git directories keep the V1 project_id = 'global'. V2 creates a new project id for the directory and the TUI scopes the session list to it, so the TUI shows 0 sessions while the desktop app still lists the same sessions.
Evidence for /Users/lasakondrej/Projects/opencode-test (not a git repo, DB ~/.local/share/opencode/opencode.db). The desktop app shows this project as Opencode-test, but that is only a display alias for the same lowercase project — it is a single project, not two.
Sessions for this project: 30, all with project_id = 'global'.
A project row c98ce85216d0... for /Users/lasakondrej/Projects/opencode-test was created at 2026-10-18 12:38:22 (first V2 run) and has 0 sessions.
SELECT count(*) FROM session_v2 WHERE project_id LIKE 'c98ce852%' → 0.
Total sessions under project_id = 'global': 1,071 (all non-git directories), so this affects more than one project.
So the rows migrated, but the project association did not: V1 sessions stay on 'global' while V2 resolves a new per-directory project id and lists by it.
TUI vs desktop app (same machine, same database):
TUI (V2)
Desktop app (1.19.3)
Opening the TUI in this project shows 0 sessions; the desktop app lists them.
Steps to reproduce
Use V1 in a non-git project directory (sessions are stored with project_id = 'global').
Install/open V2. Migration runs and copies the sessions into session_v2.
Open the same project in the V2 TUI and list sessions → "No sessions available".
Open the desktop app (1.19.3) → the same sessions are listed.
Expected behavior
Migrated sessions are visible in the V2 TUI, or the TUI falls back to sessions matching the directory when the resolved project has none.
Actual behavior
TUI shows 0 sessions; the desktop app shows them, so history looks lost in the TUI.
Suggested fix
During migration, reassign V1 sessions whose project_id = 'global' to the per-directory project created in V2 (or make the TUI fall back to directory matches when the resolved project has no sessions).
Thanks for the detailed report and the DB evidence. I think this is a duplicate of #49827. In both, the V1→V2 migration leaves sessions from non-git directories under project_id = 'global', while V2 creates a new project for the directory and lists sessions by that project, so the TUI shows none of them.
Possible duplicates and related issues, most likely first:
@opencode-agent agreed — this is the same root cause as #49827, so I won't claim it's different. New details worth adding there:
Still reproduces on v2.0.32 (CLI) with desktop app 1.19.3, macOS 15.2, on 2026-10-18.
Both tables have the same row count (session = session_v2 = 5,241), so the rows were copied but the project link was not.
The per-directory project row (c98ce852…) is created on the first V2 run with 0 sessions (SELECT count(*) FROM session_v2 WHERE project_id LIKE 'c98ce852%' → 0), while 1,071 sessions remain under project_id = 'global'.
Cross-client symptom on the same DB: the v1 desktop app still lists those sessions, the V2 TUI shows 0.
Happy for you to close this as a duplicate — I can move the details above into #49827 if that's helpful. A directory fallback when the resolved project has no sessions would fix the symptom without touching the migration.
Thanks for confirming, and for the extra details. Yes, please add them to #49827. Your data points are useful there: it still happens on v2.0.32, session and session_v2 have the same row count, the new per-directory project has 0 sessions while 1,071 stay under global, and the v1 desktop app vs V2 TUI difference on the same database. Your suggestion to fall back to directory matching fits well there too. Some of the open PRs take that kind of runtime approach (#54048), and others fix the migration itself (#56322, #51935).
This issue will still be closed as a duplicate of #49827 at the time noted earlier.
@opencode-agent done — added the data points to #49827 (v2.0.32 confirmation, equal row counts, the new per-directory project at 0 sessions vs 1,071 under global, and the v1 desktop app vs V2 TUI difference), plus the screenshots. Fine to close this one as a duplicate.
Thanks for moving the details and screenshots to #49827. Follow that issue for updates. This one will be closed as its duplicate at the scheduled time.
Closing this as a duplicate of #49827, as agreed. Thanks for moving your v2.0.32 details and screenshots there. Please follow #49827 and the open fix PRs (#56322, #51935, #54048) for progress on migrated non-git sessions staying under global.
Activity
opencode-agent commentedon Oct 18, 2026
Thanks for the detailed report and the DB evidence. I think this is a duplicate of #49827. In both, the V1→V2 migration leaves sessions from non-git directories under
project_id = 'global', while V2 creates a new project for the directory and lists sessions by that project, so the TUI shows none of them.Possible duplicates and related issues, most likely first:
globalproject and are hidden in the TUI after upgrading), with confirmations up to v2.0.28project_id='global'for non-git directories, so the sessions never appear in the per-directory pickerglobalsessions stay unattributed after migration and are hidden from V2's session listIf you have new details, adding them to #49827 would help, for example that this still happens on 2.0.32.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
jimicze commentedon Oct 18, 2026
@opencode-agent agreed — this is the same root cause as #49827, so I won't claim it's different. New details worth adding there:
session=session_v2= 5,241), so the rows were copied but the project link was not.projectrow (c98ce852…) is created on the first V2 run with 0 sessions (SELECT count(*) FROM session_v2 WHERE project_id LIKE 'c98ce852%'→ 0), while 1,071 sessions remain underproject_id = 'global'.Happy for you to close this as a duplicate — I can move the details above into #49827 if that's helpful. A directory fallback when the resolved project has no sessions would fix the symptom without touching the migration.
opencode-agent commentedon Oct 18, 2026
Thanks for confirming, and for the extra details. Yes, please add them to #49827. Your data points are useful there: it still happens on v2.0.32,
sessionandsession_v2have the same row count, the new per-directory project has 0 sessions while 1,071 stay underglobal, and the v1 desktop app vs V2 TUI difference on the same database. Your suggestion to fall back to directory matching fits well there too. Some of the open PRs take that kind of runtime approach (#54048), and others fix the migration itself (#56322, #51935).This issue will still be closed as a duplicate of #49827 at the time noted earlier.
jimicze commentedon Oct 18, 2026
@opencode-agent done — added the data points to #49827 (v2.0.32 confirmation, equal row counts, the new per-directory project at 0 sessions vs 1,071 under
global, and the v1 desktop app vs V2 TUI difference), plus the screenshots. Fine to close this one as a duplicate.opencode-agent commentedon Oct 18, 2026
Thanks for moving the details and screenshots to #49827. Follow that issue for updates. This one will be closed as its duplicate at the scheduled time.
opencode-agent commentedon Oct 19, 2026
Closing this as a duplicate of #49827, as agreed. Thanks for moving your v2.0.32 details and screenshots there. Please follow #49827 and the open fix PRs (#56322, #51935, #54048) for progress on migrated non-git sessions staying under
global.