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
session: V1 sessions in non-git directories hidden after V2 migration (project_id stays 'global') #55633
After upgrading from V1 to V2, sessions created in a non-git directory (e.g. $HOME) are no longer listed by /session when launching OpenCode from that same directory. The V1 sessions were migrated into session_v2 with project_id = 'global', but V2 creates a new directory-based project for the same path, so the session list (filtered by project) only shows sessions created after the upgrade.
Environment
opencode version: 2.0.29
OS: Darwin 27.0.0 (macOS, arm64)
Terminal: VS Code integrated terminal (TERM=xterm-256color, COLORTERM=truecolor)
Shell: /bin/zsh
Install/channel: latest
Active plugins: none in config ("plugin": []); one legacy local file ~/.config/opencode/plugin/done-sound.js
Reproduction
With V1, create sessions while running opencode in a non-git directory (e.g. ~). V1 stores them under project global.
Upgrade to V2 and let the V1→V2 data migration complete (kvmigration.v1-v2 = {"phase":"completed"}).
Run opencode from the same directory (~) and open /session.
Expected Behavior
V1 sessions created in ~ appear in the session list, as they did in V1.
Actual Behavior
Only sessions created after the upgrade are listed. In the database:
session_v2 has 71 rows with directory = '/Users/<user>' and project_id = 'global' (all migrated from V1).
V2 created a new project 30b4af67… with worktree = '/Users/<user>' on first launch; new sessions in ~ use this project ID.
/session filters by the new project ID, so all 71 migrated sessions are hidden.
Sessions in git repositories migrated correctly (project ID matches).
Additional Context
Database is ~27 GB; migration otherwise completed. One unrelated warning: Skipped V1 migration row reason=invalid-part observedType=tool.
Workaround: manually UPDATE session_v2 SET project_id = '<new id>' WHERE project_id = 'global' AND directory = '<dir>'.
Suggested fix: during migration (or project resolution), map V1 global-project sessions to the V2 directory project for their directory, or have the session list include global sessions whose directory matches the current location.
Thanks for the clear report and the database details! I think this is a duplicate of #49827. In both, V1 sessions from non-git directories keep project_id = 'global' after the V1→V2 migration, V2 creates its own project for that directory, and /session hides the migrated sessions.
Possible duplicates and related issues, ordered by likelihood:
Please follow #49827 and the open PRs above for progress. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
We haven't heard back, so I'm closing this as a duplicate of #49827. In that issue too, V1 sessions from non-git directories keep project_id = 'global' after the V1→V2 migration, so /session hides them when you run OpenCode from that directory. Please follow #49827 and the open fix PRs #51935 and #54048 for progress.
Until a fix lands, your UPDATE workaround should work, but #50551 notes that the session path may also need to be normalized before the sessions show up in the list. If your problem turns out to be different, reply here and we can reopen.
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the clear report and the database details! I think this is a duplicate of #49827. In both, V1 sessions from non-git directories keep
project_id = 'global'after the V1→V2 migration, V2 creates its own project for that directory, and/sessionhides the migrated sessions.Possible duplicates and related issues, ordered by likelihood:
globalsessions hidden after the V1→V2 upgradepathmay need to be normalized as well asproject_id, which matters for your manualUPDATEworkaroundsession listPlease follow #49827 and the open PRs above for progress. 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 16, 2026
We haven't heard back, so I'm closing this as a duplicate of #49827. In that issue too, V1 sessions from non-git directories keep
project_id = 'global'after the V1→V2 migration, so/sessionhides them when you run OpenCode from that directory. Please follow #49827 and the open fix PRs #51935 and #54048 for progress.Until a fix lands, your
UPDATEworkaround should work, but #50551 notes that the sessionpathmay also need to be normalized before the sessions show up in the list. If your problem turns out to be different, reply here and we can reopen.