Repository navigation
Description
Description
Migrated v1 sessions are listed by the TUI, but selecting one does not open it, and migrated sessions are missing from the project-scoped session list.
Two symptoms after migrating from v1 (1.14.32-1.18.32) to 2.0.22. The data migration itself is fine: opencode api get /api/experimental/migration/v1 returns {"status":"completed"} and every transcript is intact.
1. Selecting a session does nothing. Pressing Ctrl+O (recent sessions and projects) does list the migrated sessions, but selecting one leaves the TUI on the current session. The session row is never touched: time_viewed stays NULL and the server log contains no activity for that session id after the upgrade. The only way I found to open it is opencode -s <sessionID>, which works and shows the full transcript.
2. Not in the normal session list. Migrated sessions keep the v1 project_id = "global" (v1 used it for directories that are not git repos), while v2 scopes /sessions and opencode session list to the current project and creates a separate project entry for that same directory. 30 of 37 migrated sessions are affected (/home/nicola 23, ~/blender 6, ~/trading 1). Sessions from git repos are unaffected and list normally.
No data loss. The session I failed to open is fully intact: 56 messages, 217 parts, every assistant message has finish and time.completed, last message `finish: "stop", 0 orphan parts.
Expected: either selecting a listed session opens it, or the migration re-maps project_id from the stored session_v2.directory/path so migrated sessions are reachable from the project-scoped views.
Plugins
none
OpenCode version
2.0.22 (channel: latest), upgraded from v1 1.14.32-1.18.32
Steps to reproduce
- Use v1 (1.14.x-1.18.x) from a directory that is not a git repo and create a few sessions.
- Upgrade to v2 (2.0.22) and start it once so the data migration completes.
- Start v2 in that same directory and press Ctrl+O: the migrated sessions are listed.
- Select one of them. Nothing opens, the TUI stays on the current session.
- Close and reopen v2: the session is not reachable from either view any more.
opencode -s <sessionID>opens it correctly with the complete transcript.- Read-only DB checks confirm it was never opened and nothing was modified:
SELECT time_viewed, time_updated FROM session_v2 WHERE id='<id>'->time_viewedNULL,time_updatedstill the v1 timestampSELECT count(*) FROM session_message WHERE session_id='<id>'-> 56grep <sessionID> ~/.local/share/opencode/log/opencode.log-> no entries after the upgrade
Screenshot and/or share link
No response
Operating System
Linux Mint 22.3 (Linux 6.8.0-111-generic)
Terminal
unknown terminal app (TERM=xterm-256color, COLORTERM=truecolor)
Activity
Nitu-Bathyal commentedon Oct 3, 2026
can you assign this to me?
github-actions commentedon Oct 3, 2026
This issue might be a duplicate of existing issues. Please check:
globaland are missing from the project-scoped session list.project_id = "global"migration behavior for non-git directories./sessionslist (reported with a different suspected migration cause).For keybind-related issues, please also check our pinned keybinds documentation: #4997
rekram1-node commentedon Oct 21, 2026
The missing-from-project-list part is tracked in #49827. For selecting a session not opening it: does this still happen on 2.1.x? If so, please share the session ID and any errors from the log around the time you select it.
opencodejr commentedon Oct 27, 2026
Thanks for the detailed report. I reproduced the session-list part on 2.0.22, but not the Ctrl+O part.
Sessions missing from the project list (reproduced). I created two sessions with v1 1.18.32 in a directory that isn't a git repo, then let v2.0.22 migrate them (the migration reports
completed). Both sessions keepproject_id = 'global', v2 creates a separate project for that directory, andopencode session listthere shows nothing. The script below does this.On the latest
dev(45b53fe6f), a fresh migration now puts these sessions under the directory's own project (#56322; no release includes it yet). However, a database that an earlier v2 release has already migrated, like yours, stays underglobalondevtoo. The migration is marked complete and doesn't run again. So this still affects you on the latest code.Ctrl+O selection (not reproduced). On 2.0.22, choosing a migrated session in the Ctrl+O menu opened it for me, both from the home screen and while another session was open. My test sessions were empty, though. If this keeps happening for you, these would help:
Until then,
opencode -s <sessionID>remains a workaround, as you found.Reproduction script (repro.sh)
Run it:
sh repro.sh