Repository navigation
fix(core): cap WebSocket idle timeout retries - #58076
vkpdeveloper wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Looks good. I ran the reproduction script for #57127. On the base branch, a WebSocket idle-timeout got 10 retries while an HTTP Timeout stopped after 3. With this change both stop after 3. The new tests fail on the base and pass here, and typecheck for packages/core passes. The idle-timeout code matches what model-transport.ts raises when the 30-minute idle wait runs out. The other WebSocket timeout, connect-timeout, gives up after 15s, so keeping it under the general allowance makes sense.
Public API: unchanged.
One thing to coordinate: open PR #54544 changes the same timeout check for gateway 504s, and its tests expect WebSocket idle timeouts to keep the full 10-retry allowance. Whichever merges second will need to update that.
Related: #49030
There was a problem hiding this comment.
The only new commit merges dev. The pull request's own change is the same as in the last review. I re-ran the reproduction script for #57127 and session-runner-retry.test.ts at the new head: a WebSocket idle-timeout now stops after 3 retries, the same as an HTTP Timeout, and all tests pass. typecheck for packages/core also passes. Nothing new to raise.
Public API: unchanged.
Issue for this PR
Fixes #57127
Type of change
What does this PR do?
WebSocket idle timeouts come back with code
idle-timeout, but the timeout counter inmodel-retry.tsonly countsTimeout. So they skip the 3-timeout cap and use the general 10-retry schedule, and a dead stream can hold a step for hours. This countsidle-timeoutin the same timeout budget. Non-timeout failures (like WebSocket disconnects) keep the 10-retry allowance.How did you verify your code works?
Added tests in
session-runner-retry.test.tsfor repeated WebSocket idle timeouts, mixed HTTP/WebSocket timeouts, and disconnects still getting 10 retries. The two timeout tests fail without the fix (a 4th retry is allowed) and pass with the fix.bun run checkpasses. The full core suite has 2 failures that also fail without this change.Screenshots / recordings
Not a UI change.
Checklist
Code by gpt-6-astra (xhigh) in Codex CLI. PR description written with Claude Code (Opus 5.5).
🤖 Generated with Claude Code
Added by the opencode bot (AI-generated).
Related: #49030