GeezerVison is showing github.com — migrate-v1: sessions created in V1 (global+subpath) hidden from V2 session list · Issue #54521 · anomalyco/opencode
migrate-v1: sessions created in V1 (global+subpath) hidden from V2 session list #54521DescriptionDescription
After updating from OpenCode 1 to OpenCode 2, sessions created with V1 are missing from the TUI session list even though the data is intact in the database.
Two related project-binding issues cause this:
-
V1 stored sessions for non-repo directories under the special global project (canonical: "/") with a subpath field (e.g. Users/cretivoxmacden). V2 treats each directory as its own project (opening ~ creates a brand-new project id for /Users/cretivoxmacden), so all legacy global + subpath sessions no longer match the V2 location filter and are silently hidden. ~73 sessions were affected for the home directory alone.
-
Stale legacy subpath on real-project sessions. A root session that already belonged to a proper (git) project could still carry a V1-era subpath equal to its full path (e.g. Volumes/SSD 7/(ARAP) NITIP/CVE-Tools for project /Volumes/SSD 7/(ARAP) NITIP/CVE-Tools). The session list is scoped by location including subpath, so that root session is excluded (project + subpath="" returns 0) → empty list, even though the TUI auto-resumes the session.
User impact: it looks like all sessions were deleted after the V1→V2 upgrade.
Plugins
None configured.
OpenCode version
2.0.26
Steps to reproduce
- With opencode 1.x, run opencode in a directory that is not a git repo (e.g.
~) and create one or more sessions.
- (variant) In a git-repo directory, create a root session so it carries a legacy
subpath.
- Update to opencode 2.x and open opencode in the same directory.
- Press
Ctrl+X then L (or run /sessions).
- The old sessions are missing from the list.
Screenshot and/or share link
None available.
Operating System
macOS (Darwin 23.6.0, arm64)
Terminal
Apple Terminal (TERM=xterm-256color, SHELL=/bin/zsh)
Additional context / workaround
GET /api/experimental/migration/v1 → {"status":"completed"}; all DB migrations complete without error.
- Evidence of the mismatch (session query filters):
project=global&subpath=Users/cretivoxmacden → 73 sessions (the "missing" ones).
project=<the new home project id> → 0 before re-binding.
- Project for a stale-subpath root:
project=<git project> → 15, but project=<git project>&subpath= → 14 (the root with stale subpath is excluded), and project=<git project>&parentID=null&subpath= → 0.
- Workaround that fixes it: re-bind each affected session with
POST /api/session/{id}/move to its own directory — this re-computes projectID/subpath. For a stale-subpath root, a move away and back clears the field and the session reappears.
- Expected: sessions created in V1 for a directory should remain visible after migrating to V2, without manual re-binding.
Activityopencode-agent commented on Oct 11, 2026 Thanks for the detailed report and the workaround! I think this is a duplicate of #49827: V1 sessions from non-git directories stay under the global project after the V1→V2 migration, so V2's per-directory session list hides them.
Possible duplicates and closely related issues, ordered from most to least likely:
If the stale-subpath case on git-project sessions isn't covered by these, please reply and explain how it differs, and we can track it separately. Otherwise the bot will close this issue as a duplicate in 1 day.
opencode-agent commented on Oct 12, 2026 We haven't heard back, so I'm closing this as a duplicate of #49827: V1 sessions from non-git directories stay under the global project after the V1→V2 migration and are hidden from the per-directory session list. Please follow #49827 and the open fix PR #51935 for updates. Until then, your POST /api/session/{id}/move workaround should keep those sessions visible.
If the stale-subpath problem on git-project root sessions keeps happening and isn't covered by #49827 or #51144, please reply here or open a new issue with the details.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|