Skip to content

fix(openai): retry correlated transient WebSocket failures - #33

Merged
danielkov merged 2 commits into
mainfrom
fix/websocket-transient-response-failure
Oct 12, 2026
Merged

danielkov merged 2 commits into
mainfrom
fix/websocket-transient-response-failure

Conversation

@danielkov

@danielkov danielkov commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Retry correlated transient WebSocket response.failed events on a fresh socket instead of terminating the turn after the first attempt. Reuse the existing retry budget, backoff, cancellation, and response-attempt supersession paths. Bump agentkit-provider-openai to 0.10.13 so the fix can be published without a separate version-bump PR.

Motivation

A ChatGPT server failure such as server_error with status 503 is classified as transient, but the WebSocket acceptance gate currently stops it before retries are scheduled. An explicit terminal failure should be recoverable under the same replay safeguards used for a lost connection.

Technical details

Authorize replay only for the active response

Require a validated terminal event with an explicit response ID matching the active response, store: false, and either no visible output or an opted-in supersession consumer. Malformed sequence numbers are rejected as protocol errors rather than silently ignored. Permanent failures and uncorrelated wrapped errors retain the existing no-replay restrictions.

Reopen without failed continuation state

Discard the failed socket and its checkpoint before replaying the authoritative full request, without previous_response_id. Update the documented retry policy and regression coverage for recovery, supersession, continuation replay, and retry exhaustion.

@danielkov
danielkov merged commit 634d86e into main Oct 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant