fix(core): close websocket after provider error frame - #47973
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
errorframe the transport kept the channel for reuse, so the next exchange could be written to a connection the server had already given up on and fail the step withprovider.transport: WebSocket closed with code 1000—delivery: ambiguous, which is deliberately never retried. Seen live during a WebSocket soak against a ChatGPT Codex credential.provider-failureand bothrejectedrecoveries), so the runner's retry or the next step opens a fresh connection. Therotate-and-retry-fullspecial case is subsumed.session websocket sending … mode=full|incrementalandsession websocket poisoned … code= active=.Probed both backends with a raw
response.createsocket after an error frame (previous_response_not_foundand a bad model):api.openai.comkeeps the socket open; a follow-up request on it succeeds. Reconnecting after an error costs one handshake there.chatgpt.com/backend-api/codexstops serving the connection after either error: the follow-up request is never answered and the socket dies with 1006 ~2.7 s later. That includes the stale-previous_response_idcase, soretry-fullon the same socket would have hung and failed the same way.Groundwork for making the channel the default.
Validation
closes the connection after a provider error frame so the next call reconnects;clears a rejected checkpoint before the runner retries fulland the liveclears a rejected continuation …test now expect the retry on a second connection.session-model-transport,session-checkpoint-transport,session-model-transport-live: 38 passed. Core suite viabun run test: 5,248 passed, 35 skipped. Core typecheck clean.Follow-up
Codex reports a stale continuation as
invalid_request_errorwith message "Invalidprevious_response_id." and nocode, soOpenResponsesContinuationnever classifies it asretry-fullthere; the step fails instead of retrying full.