Fixes infinite hang when sending a message via the OpenCode provider in the web UI.
Root cause: The SDK SSE client defaults to infinite reconnection attempts when sseMaxRetryAttempts is undefined (at serverSentEvents.gen.js:122). During reconnection, critical events like session.status -> idle are lost, so the code path that calls emitUnexpectedExit is never reached and the client hangs forever.
Fix: Pass sseMaxRetryAttempts: 1 through the SDK client creation chain so a single SSE failure terminates and lets the existing error-projection code handle it.
Closes #2691, #2644, #2886, #2579 (same symptom).
Note
Limit SSE reconnection to 1 retry attempt in OpenCodeAdapter#
Adds a sseMaxRetryAttempts: 1 option when creating the OpenCode SDK client to prevent infinite hangs on SSE connection failures. The createOpenCodeSdkClient function in opencodeRuntime.ts now accepts an optional sseMaxRetryAttempts parameter and forwards it to the underlying client. Behavioral Change: SSE connections that previously retried indefinitely will now stop after 1 attempt.
Macroscope summarized 6a0dd2c.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
d4a52032-6b74-4f73-bcd0-5295ae4efb03You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share