Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(opencode): limit SSE reconnection attempts to prevent infinite hang #2908

Closedkarldane(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2908/headopened View on GitHub

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.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: d4a52032-6b74-4f73-bcd0-5295ae4efb03

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

Sign in to join this conversation.