Skip to content

Retry on errors, with exponential interval! #41

Description

@dzianisv

Right now if some error happens, codex just stuck, that is not good

on any error codex just has to retry with some exponential interval!

For instance, just caught stream disconnected before completion: error sending request for url
(https://vibebrowser-dev.openai.azure.com/openai/responses?api-version=2025-04-01-preview) and it stopped!

Activity

  1. OpenCodeEngineer commented on Mar 26, 2026

    @OpenCodeEngineer

    Investigating now. The current retry loop already backs off on retryable stream failures, but it only gives a minimal recovery path when stream_max_retries = 0. I’m patching codex-core so transient dropped streaming requests keep replaying with exponential backoff using the provider retry budget, and I’m adding regression coverage for repeated Azure-style disconnects before opening the PR.

  2. dzianisv commented on Mar 26, 2026

    @dzianisv
    OwnerAuthor

    Implemented on issue-41-retry-transport-disconnects and opened PR #42.

    What changed:

    • reuse the provider request retry budget when stream_max_retries = 0 and the failure is a transient transport disconnect
    • keep zero-retry behavior for non-transport stream errors and keep honoring any nonzero explicit stream retry budget
    • add regressions for repeated incomplete SSE streams in both the in-process core path and the real codex exec CLI path

    Validated locally with:

    • cargo test -p codex-core effective_stream_retry_budget --color never
    • cargo test -p codex-core --test all suite::stream_no_completed::retries_replayed_stream_request_when_stream_retries_are_disabled --color never -- --exact
    • cargo build -p codex-cli --bin codex --color never
    • cargo test -p codex-core --test all suite::cli_stream::responses_mode_stream_cli_retries_replayed_stream_request_when_stream_retries_disabled --color never -- --exact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions