Desktop migrates shared DB; older CLI on PATH fails opencode run with no such column: replacement_seq (Unexpected server error) · Issue #38471 · anomalyco/opencode · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop migrates shared DB; older CLI on PATH fails opencode run with no such column: replacement_seq (Unexpected server error) #38471
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 opencode-ai@1.17.3) 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)
Multica / CLI opencode run: fails with Unexpected server error (old binary + new schema)
DB evidence
migration table includes 20260622142730_simplify_session_context_epoch
PRAGMA table_info(session_context_epoch) had only: session_id, baseline, snapshot, baseline_seq (no replacement_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 as version=local / newer schema owner)
CLI on PATH used by Multica: 1.17.3 (opencode-ai@1.17.3 via nvm/npm)
Steps to reproduce
Install/use OpenCode Desktop long enough for migration 20260622142730_simplify_session_context_epoch to run on ~/.local/share/opencode/opencode.db
Keep an older CLI on PATH (e.g. npm opencode-ai@1.17.3) that still contains requestReplacement
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
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).
This issue might be a duplicate of existing issues. Please check:
task tool fails with "no such column: replacement_seq" when plugin lags behind CLI #35403: Same no such column: replacement_seq error, 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.
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.