anomalyco / anomalyco/opencode
[Bug] Unhandled database schema mismatch causes prompt_async silent failure and client request timeout
Open
@rekram1-node is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
When opencode serve (CLI) and OpenCode Desktop share the same database (~/.local/share/opencode/opencode.db), upgrading Desktop ahead of CLI creates a database schema mismatch (e.g. newer migrations like simplify_session_context_epoch removing columns).
Steps to Reproduce
- OpenCode Desktop runs on version 1.18.x and applies new database migrations to ~/.local/share/opencode/opencode.db.
- An older CLI binary (1.17.x) is run in headless server mode (opencode serve).
- A client connects, creates a session, and sends a prompt/message (/session/:id/prompt_async).
Actual Behavior
- opencode serve crashes internally on prompt_async with:
prompt_async failed cause="Cause([Die(SQLiteError: no such column: replacement_seq)])" - No error event or failure response is returned/streamed to the client/frontend.
- The client hangs waiting for SSE stream until it eventually times out.
Expected Behavior
- OpenCode should validate database schema compatibility on startup/query and log a user-friendly error (e.g., "Database schema is newer than binary version, please update opencode").
- If prompt_async or LLM orchestration dies with an unhandled exception, an error event should be dispatched to the client immediately instead of hanging indefinitely.
Additional Context
- OS: Ubuntu 25.10 / Linux
- CLI Version: 1.17.7
- Desktop Version: 1.18.23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.