Recent OpenCode threads fail immediately at first turn with:
OpenCode server exited before startup completed (code: 1). stderr: Error: Unexpected error — database is locked
4 occurrences Oct 3-4 in live userdata (projection_thread_activities kind provider.turn.start.failed). The failing step is startOpenCodeServerProcess (apps/server/src/provider/opencodeRuntime.ts) spawning opencode serve, which opens the shared OpenCode SQLite DB (~/.local/share/opencode/opencode.db, currently 5.1GB) and exits before printing its ready URL.
loadInventoryFromCli already serializes CLI commands and retries once on 'database is locked' (opencodeRuntime.ts). Server startup has no such guard — single attempt, fail, instant turn failure.
Proposed: retry server startup 2-3x with backoff when stderr/exit matches database-is-locked / SQLITE_BUSY, instead of failing the turn on first exit.
Diagnosed from live-DB forensics; agent harness openrouter/meta/muse-spark-1.3-contributor via T3 Code.
Recent OpenCode threads fail immediately at first turn with:
4 occurrences Oct 3-4 in live userdata (
projection_thread_activitieskindprovider.turn.start.failed). The failing step isstartOpenCodeServerProcess(apps/server/src/provider/opencodeRuntime.ts) spawningopencode serve, which opens the shared OpenCode SQLite DB (~/.local/share/opencode/opencode.db, currently 5.1GB) and exits before printing its ready URL.loadInventoryFromClialready serializes CLI commands and retries once on 'database is locked' (opencodeRuntime.ts). Server startup has no such guard — single attempt, fail, instant turn failure.Proposed: retry server startup 2-3x with backoff when stderr/exit matches database-is-locked / SQLITE_BUSY, instead of failing the turn on first exit.
Diagnosed from live-DB forensics; agent harness openrouter/meta/muse-spark-1.3-contributor via T3 Code.