anomalyco / anomalyco/opencode

[Bug] Session re-registration storm causes silent failures

Open
#47,219 0 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Sep 4, 2026.

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

Description

Description

When a session becomes invalid or disconnected, the OpenCode desktop app repeatedly re-registers the session without exponential backoff. This creates a request storm and can cause the edge proxy to terminate the connection. The UI then accepts messages but no inference is triggered.

During the failure, the SSE stream contains dozens of identical registration events per second for several minutes, even when no files are being modified. Cloudflare logs show connection closures with error code 0 at the same time. Re-sending the same message usually creates a fresh session and restores responses.

The issue is significantly more frequent with approximately 8 or more session tabs open. Please consider exponential backoff with jitter for session re-registration, capped at 30 to 60 seconds.

Plugins

None

OpenCode version

1.18.18

Steps to reproduce
  1. Run OpenCode Desktop through Cloudflare and nginx to opencode serve.
  2. Open approximately 8 or more session tabs for the same server.
  3. Invalidate or disconnect the active session while the tabs remain open.
  4. Observe repeated registration requests in the SSE stream, followed by connection drops and a silent UI state.
  5. Resend the same message and observe that a fresh session usually restores responses.
Screenshot and/or share link

None

Operating System

macOS 26.5.2 (arm64)

Terminal

iTerm2

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.