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
sessions: V1 sessions under "global" project hidden after upgrading to 2.0 #56030
After upgrading from OpenCode 1.x to 2.0.30, sessions created in V1 from the home directory no longer appear in the session list. The data is intact in the database, but it is filtered out because the home directory became its own project in V2.
Use OpenCode 1.x from ~ (not a git repo) and create several sessions. They are stored under project global.
Upgrade to OpenCode 2.0.30.
Run opencode (or opencode session list) from ~.
Expected Behavior
Previous sessions remain visible, as the migration guide states that supported V1 functionality should stay compatible.
Actual Behavior
Only sessions created after the upgrade are listed (2 in this case). opencode session list -n 500 from ~ returns just those.
Inspecting a copy of opencode.db:
session (V1 table): 100 rows; session_v2: 102 rows; no V1 session is missing in V2.
54 sessions with directory='/home/admdiegofco' (Aug 7 to Oct 16) have project_id='global' (project worktree /).
Sessions created with V2 in the same directory have project_id='a23da999...' (project worktree /home/admdiegofco).
Sessions from real git projects (e.g. iac-crlnxend) keep their own project and are unaffected.
The list is scoped by project, so the 54 older sessions are hidden.
Additional Context
Frequency: consistent.
Workaround: manually UPDATE session/session_v2 SET project_id=<new project> WHERE project_id='global' AND directory='/home/admdiegofco' with the service stopped and a DB backup.
Suggested fix: on migration, reassign legacy global sessions to the project that now owns their directory, or include global sessions when listing for a directory that was previously global.
Thanks for the detailed report and the DB analysis. I think this is a duplicate of #49827. After the V1→V2 migration, sessions that V1 created in non-git directories (like ~) stay on the legacy global project. V2 creates a separate project for that directory, and since the session list only shows the current project's sessions, those older sessions are hidden.
Possible duplicates and closely related issues, ordered by likelihood:
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Feel free to add your numbers to #49827.
We haven't heard back, so I'm closing this as a duplicate of #49827. After the V1→V2 migration, sessions that V1 created in non-git directories (here ~) stay on the legacy global project, and V2 creates a new project for that directory, so the session list hides them. Your data is still in the database. Please follow #49827 for updates. #51935 is the open PR that would reassign those sessions to their directory's project. If your case turns out to be different, reply here and we can reopen.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the detailed report and the DB analysis. I think this is a duplicate of #49827. After the V1→V2 migration, sessions that V1 created in non-git directories (like
~) stay on the legacyglobalproject. V2 creates a separate project for that directory, and since the session list only shows the current project's sessions, those older sessions are hidden.Possible duplicates and closely related issues, ordered by likelihood:
globalare hidden after upgrading (the main issue to follow; it also has asession moveworkaround and notes from other users)globalsessions to the project that owns their directory, which is what you suggestedpath=NULLare missing from project session lists, which can also affect your manualUPDATEworkaroundThe bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Feel free to add your numbers to #49827.
opencode-agent commentedon Oct 17, 2026
We haven't heard back, so I'm closing this as a duplicate of #49827. After the V1→V2 migration, sessions that V1 created in non-git directories (here
~) stay on the legacyglobalproject, and V2 creates a new project for that directory, so the session list hides them. Your data is still in the database. Please follow #49827 for updates. #51935 is the open PR that would reassign those sessions to their directory's project. If your case turns out to be different, reply here and we can reopen.