Repository navigation
Description
Description
After upgrading the CLI from V1 to V2, pre-existing sessions disappear from the TUI /sessions dialog — from both the default list and the title search. The session data and the fix's prerequisites are intact, but the V1→V2 importer keeps session.path unnormalized: it stores the absolute directory with the leading slash removed (e.g. Users/alice/Projects/foo) in a column that must hold the path relative to the project worktree (empty string at the project root). The /sessions dialog filters by the current relative path, so these migrated sessions never match.
A maintainer reproduced this on 2.0.20 and identified the V1 sequence behind it: sessions created in a non-git directory are filed under the global project with the stripped absolute path; after git init, V1 moves the sessions to the new project but leaves path unchanged; V2 then copies path as-is into session_v2.
Same underlying problem is tracked (still open) in #49827, #50551, #50800 and #51176. The suggested duplicate #52844 was automatically closed for template compliance, not because the bug was fixed. Two proposed fixes are still open and unmerged: #51935 (migration-time re-attribution + repair on next start) and #54048 (runtime resolution for markerless directories).
Plugins
oh-my-opencode-slim@latest, @mohak34/opencode-notifier@latest, @openviking/opencode-plugin, plus one local file:// plugin. (The bug also reproduces with plugin behavior factored out; it is caused by the importer, not a plugin.)
OpenCode version
2.0.20 (Homebrew, latest channel). Original sessions created with V1 1.18.x; V1 desktop 1.18.34 still shows them because it lists by directory without this path filter.
Steps to reproduce
- In V1, create sessions in a directory that is not yet a git repo. V1 stores them under the
globalproject withpath= absolute directory without leading slash, e.g.Users/alice/Projects/foo. git initthat directory and use V1 there again. V1 moves the sessions to the new git project but leavespathunchanged.- Start V2. The background migration runs (
GET /api/experimental/migration/v1→{"status":"completed"}) and copiespathunchanged intosession_v2. - Open the TUI at the project root and run
/sessions.
Observed in the database:
SELECT id, path FROM session
WHERE path LIKE 'Users/%' OR path LIKE 'private/%';Expected behavior
Migrated sessions at the project root have path = '' (path relative to the worktree) and show up in /sessions and the dialog search, matching how V1 listed them.
Actual behavior
The migrated sessions keep the stripped absolute path, so they are absent from the default /sessions list and from title search. They can only be reached via the "all projects" toggle, marked ... Messages/parts are intact and the HTTP API (/api/session) returns the sessions; only the TUI dialog hides them. On this machine 79 rows were affected (18 in the git project, 61 still under global), in both session and session_v2.
Stopgap used to restore visibility (database backed up first), confirmed working:
UPDATE session SET path='' WHERE path LIKE 'Users/%' OR path LIKE 'private/%';
UPDATE session_v2 SET path='' WHERE path LIKE 'Users/%' OR path LIKE 'private/%';then opencode service restart. An alternative per-session repair is POST /api/session/{id}/move with the same directory.
Operating System
macOS (Darwin 25.4.0, arm64)
Terminal
Apple Terminal (TERM=xterm-256color, COLORTERM=truecolor); shell /bin/zsh.
Screenshot and/or share link
None.
Activity
github-actions commentedon Oct 7, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of an existing issue. Please check:
session.pathunnormalized, hiding migrated sessions from the TUI/sessionslist.If you believe this was flagged incorrectly, please let a maintainer know.
opencode-agent commentedon Oct 7, 2026
Thanks for the detailed report. I was able to reproduce this on 2.0.20 with a real V1 (1.18.34) database:
globalproject withpathset to the absolute directory without its leading slash, e.g.Users/alice/Projects/foo.git initthe folder and use V1 there again. V1 moves those sessions to the new git project but leaves the oldpathas it was. This likely explains your affected rows in a project other thanglobal.pathunchanged intosession_v2./sessionsat the project root. Only sessions withpath = ''are listed; the migrated ones are missing from both the list and the search, and only show up with the "all projects" toggle, marked...The same unchanged copy also leaves the stripped absolute path on migrated sessions that stay in the
globalproject. Your SQL workaround (after a backup) is a reasonable stopgap for now.Frey-Fu commentedon Oct 10, 2026
Updated the body to follow the Bug Report template, with the required Description field first (followed by Plugins, OpenCode version, Steps to reproduce, Expected/Actual behavior, OS and Terminal). Could the compliance check please be re-run? Note the suggested duplicate #52844 was auto-closed for template compliance, not resolved; the root-cause issues (#49827, #50551, #50800, #51176) remain open and the proposed fixes #51935 / #54048 are unmerged.
Frey-Fu commentedon Oct 10, 2026
This is confirmed and reproduced, and it affects every existing V1 install that upgrades, so it would be good to land a fix rather than leave users on manual DB edits.
Two open PRs already address it (both mergeable against
v2, neither reviewed yet):globalsessions to their directory's project during the V1→V2 migration, stores the implied subpath, and repairs databases whose migration already completed on the next start; includes regression tests.Could a maintainer indicate which approach is preferred (migration-time vs runtime resolution, or whether both layers are wanted) and review the chosen one? Happy to help with review, rebase, or extra coverage on whichever PR you'd like to move forward. The root-cause issues #49827, #50551, #50800, #51176 are still open, so merging one of these would close a broad cluster.
github-actions commentedon Oct 10, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window.
Feel free to open a new issue that follows our issue templates.