GeezerVison is showing github.com — migrate: v1 sessions from non-git directories land in 'global' project and lose leading '/' in path · Issue #50521 · anomalyco/opencode
migrate: v1 sessions from non-git directories land in 'global' project and lose leading '/' in path #50521
Description
Summary
After installing OpenCode V2, sessions stored in non-git directories
(e.g. /Users/<user>/Downloads) are invisible in the session list.
Investigation of the migrated SQLite database shows two problems in the
migration: the old sessions are assigned to project_id = 'global', and their
path value is stored without the leading / (e.g.
Users/<user>/Downloads). When the TUI later starts in that directory, it
creates a new project row for /Users/<user>/Downloads, and the session list
(which queries by project) returns nothing. Session data is intact but
orphaned under the wrong project.
Environment
- opencode version: v2.0.12 (latest)
- OS: macOS (Darwin 27.0.0, arm64)
- Terminal: Ghostty (TERM_PROGRAM=ghostty)
- Shell: elvish
- Install/channel: latest
- Active plugins: none configured
Reproduction
- Run OpenCode V1 sessions in a non-git directory (e.g.
/Users/<user>/Downloads);
create several sessions.
- Upgrade to OpenCode V2 and start it in the same directory.
- Open the session list (
<leader>l) — no previous sessions appear, even
though the migration ran.
Expected Behavior
Post-migration, starting V2 in a directory that had V1 sessions should show
those sessions in the session list, matching V2's project scoping for that
directory.
Actual Behavior
The session list is empty for that directory. Inspecting the SQLite database
at ~/.local/share/opencode/opencode.db:
session rows for the affected directory have project_id = 'global' and
path = 'Users/<user>/Downloads' (missing leading /).
- On first V2 startup a new project is created for
/Users/<user>/Downloads with a generated project id, so no sessions match
it.
- Sessions below git repositories (where a matching project row already
existed) migrate correctly; only non-git directories appear affected.
Additional Context
- Data was not lost; manually updating the affected sessions'
project_id to
the newly created project id restores them in the UI.
- The old V1
storage/ directory is emptied and a migration marker file
remains, consistent with a one-time migration step that assigned these
sessions to global.
- Workaround: manual SQLite update (backup first). A migration fix would be
preferable.
Activity
github-actions commented on Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
If your report adds new information (the missing leading / in the path column is a distinct detail not covered in #49827), it may still be worth keeping open. Please check those issues and comment there or link them if they cover your situation.
Metadata
Metadata
Development
No branches or pull requestsIssue actions