Description
Description
OpenCode Desktop and OpenCode CLI share ~/.local/share/opencode/opencode.db. When Desktop (or a newer runtime) applies migration 20260622142730_simplify_session_context_epoch (from PR #33378), it drops session_context_epoch.replacement_seq / revision / agent.
An older CLI still on PATH (here: npm [email protected]) still calls SessionContextEpoch.requestReplacement during SessionPrompt.createUserMessage. Headless callers such as Multica invoke:
opencode run --format json --dangerously-skip-permissions --dir <workdir> --model <provider/model> "..."
and immediately get:
{"type":"error","error":{"name":"UnknownError","data":{"message":"Unexpected server error. Check server logs for details.","ref":"err_..."}}}With --print-logs:
SQLiteError: no such column: replacement_seq
at SessionContextEpoch.requestReplacement
at SessionPrompt.createUserMessage
at SessionPrompt.prompt
(then the next missing column after manually adding replacement_seq was session_context_epoch.revision)
Observed split behavior on the same machine
- OpenCode Desktop UI: can send messages successfully (runtime matches migrated schema)
- Multica / CLI
opencode run: fails with Unexpected server error (old binary + new schema)
DB evidence
migrationtable includes20260622142730_simplify_session_context_epochPRAGMA table_info(session_context_epoch)had only:session_id, baseline, snapshot, baseline_seq(noreplacement_seq/revision)
This is the same class of failure as “old code meets new schema” described in #33773 / #33898, but the trigger here is Desktop + independently installed older CLI on PATH, not an intentional downgrade. Tools that shell out to opencode (Multica, etc.) hit this easily because Desktop auto-updates the shared DB while npm/nvm CLI stays pinned.
Plugins
oh-my-openagent in ~/.config/opencode/opencode.jsonc (failure also reproduces the same SQLite error path; schema mismatch is the blocker before model I/O)
OpenCode version
- Desktop:
@opencode-aidesktop(sessions logged asversion=local/ newer schema owner) - CLI on PATH used by Multica:
1.17.3([email protected]via nvm/npm)
Steps to reproduce
- Install/use OpenCode Desktop long enough for migration
20260622142730_simplify_session_context_epochto run on~/.local/share/opencode/opencode.db - Keep an older CLI on PATH (e.g. npm
[email protected]) that still containsrequestReplacement - Confirm Desktop chat can send messages
- Run:
opencode run --print-logs --format json --dangerously-skip-permissions --dir <any-existing-dir> --model <configured-model> "hi"
- Observe
Unexpected server error/SQLiteError: no such column: replacement_seq
Screenshot and/or share link
N/A — log excerpt above.
Operating System
Windows 10 (win32 10.0.19045)
Terminal
PowerShell / Multica desktop daemon (multica daemon spawning CLI)
Expected
Either:
- Clear compatibility error: “database schema is newer than this OpenCode runtime; upgrade CLI to match Desktop”, or
- Desktop/CLI refuse to diverge on the shared DB without warning, or
- Destructive migrations remain compatible with the supported previous CLI window (expand-contract; see ci(core): reject downgrade-incompatible database migrations #33898)
Workaround
Align CLI version with the runtime that migrated the DB (opencode upgrade to match Desktop), or temporarily re-add dropped columns for the older CLI (fragile).
Related
- [Bug]: v1.17.10 Bun segfault + downgrade to v1.17.9 breaks SQLite schema (missing replacement_seq column) #33773 (closed) — same
replacement_seqerror after old code + new schema - ci(core): reject downgrade-incompatible database migrations #33898 (closed) — proposal to reject downgrade-incompatible migrations
- BUG: session_message.seq NOT NULL constraint failed on agent-switched sessions #31204 comments — Desktop migrates shared DB while older CLI remains on PATH
- task tool fails with "no such column: replacement_seq" when plugin lags behind CLI #35403 (open) — same column name, but opposite direction (columns expected to be added / migration bookkeeping); this report is specifically columns dropped by newer Desktop, older CLI still reading them
Activity
github-actions commentedon Jul 23, 2026
This issue might be a duplicate of existing issues. Please check:
no such column: replacement_seqerror, where a version mismatch between components causes the schema incompatibility — the root cause and fix path are closely related, though that report focuses on plugin lag while this one focuses on Desktop auto-migrating the shared DB while an older CLI on PATH (used by tools like Multica) still references dropped columns.If your scenario is not already covered by #35403, a maintainer may want to link or consolidate these.
github-actions commentedon Sep 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.