anomalyco / anomalyco/opencode
[Bug] Session re-registration storm causes silent failures
@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
- Run OpenCode Desktop through Cloudflare and nginx to
opencode serve. - Open approximately 8 or more session tabs for the same server.
- Invalidate or disconnect the active session while the tabs remain open.
- Observe repeated registration requests in the SSE stream, followed by connection drops and a silent UI state.
- 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
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.