-
Notifications
You must be signed in to change notification settings - Fork 2k
OpenAI-compatible stream_read_error bypasses automatic retry #885
Copy link
Copy link
Closed
Labels
autonomous: clearHands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.Hands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.bugSomething isn't workingSomething isn't workingtriage: fixed-pending-releaseFixed in code/committed; will close automatically on next releaseFixed in code/committed; will close automatically on next releasetriage: reproducibleClear repro + clear fix pathClear repro + clear fix path
Description
Metadata
Metadata
Assignees
Labels
autonomous: clearHands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.Hands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.bugSomething isn't workingSomething isn't workingtriage: fixed-pending-releaseFixed in code/committed; will close automatically on next releaseFixed in code/committed; will close automatically on next releasetriage: reproducibleClear repro + clear fix pathClear repro + clear fix path
Summary
A structured OpenAI-compatible stream failure with
type: upstream_errorandcode/message: stream_read_erroris surfaced immediately instead of entering Jcode's bounded transient-error retry loop.Version
5ae238574)mastersource at the same commitError shape
{ "type": "error", "sequence_number": 0, "error": { "type": "upstream_error", "code": "stream_read_error", "message": "stream_read_error" } }Actual behavior
The turn terminates with an error and requires a manual retry.
The structured error is formatted as
upstream_error: stream_read_error.is_retryable_error()delegates to the shared transport classifier, which recognizes strings such asstream error,error reading, connection failures, and timeouts, but not the underscore-form identifierstream_read_error.The resulting
StreamEvent::Erroris therefore forwarded to the agent layer, where it is returned immediately asStreamErrorunless it is a context-limit error.Relevant code:
extract_error_with_retryis_retryable_erroris_transient_transport_errorExpected behavior
stream_read_errorshould be treated as a transient stream/transport failure and use the existing bounded retry behavior, including rollback of any partial output before replay.Suggested minimal fix
Add
stream_read_errorto the shared transient transport classifier and add a regression test covering the structuredupstream_errorpayload. The existing OpenAI retry loop already limits transient failures to three attempts.