Repository navigation
Conversation
|
Been poking at reconnect behavior lately (see #48161 on v2 — client-side backoff, different layer, so no overlap here), so I read through this diff. Main thing: the Nit: with the 5s cap, the exponent clamp #48014 looks assigned internally, so if this overlaps with planned work no worries — leaving notes in case they're useful. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #48014
Type of change
What does this PR do?
The global event stream (
server-sdk.tsx) reconnected after every failure withthe same fixed
RECONNECT_DELAY_MSdelay. This adds an exponential backoff:consecutiveErrorscounter resets on every successfully consumed event andincrements on each catch;
min(5000, RECONNECT_DELAY_MS * 1.5 ** min(consecutiveErrors, 8)),so repeated failures back off from 250 ms up to a 5 s cap, while a healthy
stream keeps the fast cadence.
No other behaviour in the loop changes.
How did you verify your code works?
bun typecheckinpackages/app: clean.scoped to the loop invocation and reset on any received event, so a recovered
stream returns to the fast path immediately.
Screenshots / recordings
N/A — not a UI change.
Fork
Checklist