GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — After upgrading to OpenCode v1.2.21, previous sessions disappear from the TUI session list. · Issue #16579 · anomalyco/opencode Closed as not planned Closed as not planned Copy link DescriptionDescriptionOpenCode v1.2.21 — Session Migration FixProblemAfter upgrading to OpenCode v1.2.21, previous sessions disappear from the TUI session list. Root Causev1.2.21 changed how projects are identified:
The upgrade creates a new project entry with the git-derived ID, but the built-in For non-git directories, the global project's Diagnosis1. Locate the database2. Find the new project ID# Option A: read from git cache cat .git/opencode # Option B: compute it yourself (run from the repo) git rev-list --max-parents=0 --all | sort | head -1 3. Check for orphaned sessionsbun -e " const { Database } = require('bun:sqlite'); const d = new Database('$HOME/.local/share/opencode/opencode.db', {readonly: true}); // All sessions grouped by project_id and directory const rows = d.query('SELECT project_id, directory, COUNT(*) as c FROM session GROUP BY project_id, directory ORDER BY c DESC').all(); rows.forEach(r => console.log(r.project_id, '|', r.directory, '|', r.c, 'sessions')); " If you see sessions under FixClose OpenCode before running these. Case 1: Git-enabled directorySessions are under bun -e " const { Database } = require('bun:sqlite'); const d = new Database('$HOME/.local/share/opencode/opencode.db'); const PROJECT_ID = '<git-root-commit-sha>'; // from: git rev-list --max-parents=0 --all const DIRECTORY = '<your-project-path>'; // e.g. /home/user/my-project const before = d.query(\`SELECT COUNT(*) as c FROM session WHERE project_id = 'global' AND directory = '\${DIRECTORY}'\`).get(); console.log('Sessions to migrate:', before.c); d.run(\`UPDATE session SET project_id = '\${PROJECT_ID}' WHERE project_id = 'global' AND directory = '\${DIRECTORY}'\`); const after = d.query(\`SELECT COUNT(*) as c FROM session WHERE project_id = '\${PROJECT_ID}'\`).get(); console.log('Sessions under new project_id:', after.c); d.close(); " Case 2: Non-git directorySessions have the real directory path but the global project now expects bun -e " const { Database } = require('bun:sqlite'); const d = new Database('$HOME/.local/share/opencode/opencode.db'); const DIRECTORY = '<your-directory-path>'; // e.g. /home/user/notes const before = d.query(\`SELECT COUNT(*) as c FROM session WHERE project_id = 'global' AND directory = '\${DIRECTORY}'\`).get(); console.log('Sessions to fix:', before.c); d.run(\`UPDATE session SET directory = '/' WHERE project_id = 'global' AND directory = '\${DIRECTORY}'\`); console.log('Fixed. Sessions now accessible under global project.'); d.close(); " Verificationbun -e " const { Database } = require('bun:sqlite'); const d = new Database('$HOME/.local/share/opencode/opencode.db', {readonly: true}); const orphans = d.query(\"SELECT project_id, directory, COUNT(*) as c FROM session WHERE project_id = 'global' AND directory != '/' GROUP BY project_id, directory\").all(); if (orphans.length === 0) { console.log('No orphaned sessions. All good.'); } else { console.log('Remaining orphans:'); orphans.forEach(o => console.log(o.directory, ':', o.c, 'sessions')); } d.close(); " Notes
Upstream References
PluginsOmO OpenCode version1.2.21 Steps to reproduceAfter upgrading to 1.2.1 all sessions disappear from TUI. Even the global ones with no git. Screenshot and/or share linkNo response Operating SystemUbuntu 24.04 inside WSL2 TerminalWindows Terminal Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |