anomalyco / anomalyco/opencode

Session service -32603 errors under concurrent batch load

Open
#45,798 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 28, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Bug Description

OpenCode session service returns JSON-RPC error -32603 ("Internal error: OpenCode service failure") when processing multiple concurrent sessions or long-running batch operations.

Steps to Reproduce

  1. Submit 3+ concurrent session resume requests (e.g., batch process 3+ files in parallel)
  2. Observe that 1-3 of the sessions fail with error code -32603
  3. Retry the failed session; it succeeds (indicating service recovered, not a permanent error)

Expected Behavior

All valid session requests should either succeed or fail with a specific, actionable error code (e.g., 429 Too Many Requests for rate limits).

Impact

  • Batch processing becomes unreliable under load (3+ concurrent sessions)
  • Long-running operations fail after 20+ minutes
  • Users lose work and have no clear recovery path

Current Workarounds (Tested)

  • Reduce concurrency: Process 1–2 sessions at a time (slow but reliable)
  • Exponential backoff: Retry with 1m, 2m, 4m delays (reduces failures to ~5%)
  • Pre-flight health check: Skip batch if service is unavailable

Workarounds reduce frequency but don't eliminate the root cause.

Additional Context

We've validated this issue in production batch processing across 50+ sessions. The error is reproducible and consistently fails the same way under load.

Testing fork available at https://github.com/blogtheristo/opencode-all if upstream fix needs validation.

Error Example

{
  "code": -32603,
  "message": "Internal error: OpenCode service failure",
  "data": {
    "service": "session"
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.