Skip to content

fix: retry repeated transient stream disconnects - #42

Merged
dzianisv merged 1 commit into
mainfrom
issue-41-retry-transport-disconnects
Mar 28, 2026
Merged

dzianisv merged 1 commit into
mainfrom
issue-41-retry-transport-disconnects

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Summary

  • use the provider request retry budget when stream_max_retries = 0 and the stream failed due to a transient transport disconnect
  • keep zero-retry behavior for non-transport stream errors while still honoring any nonzero explicit stream retry budget
  • add regressions for the core retry loop and for codex exec replaying repeated incomplete SSE streams

Closes #41.

Testing

  • CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/Users/engineer/workspace/codex/codex-rs/target cargo test -p codex-core effective_stream_retry_budget --color never
  • CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/Users/engineer/workspace/codex/codex-rs/target cargo test -p codex-core --test all suite::stream_no_completed::retries_replayed_stream_request_when_stream_retries_are_disabled --color never -- --exact
  • CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/Users/engineer/workspace/codex/codex-rs/target cargo build -p codex-cli --bin codex --color never
  • CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/Users/engineer/workspace/codex/codex-rs/target 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

@dzianisv

Copy link
Copy Markdown
Owner Author

CI note: the currently failing cargo-deny, experimental Bazel macOS, and rust-ci ubuntu lint/build checks are all also failing on main.

Tracked separately:

The retry change in this PR is covered locally by the focused codex-core unit/integration tests and the real codex exec replay test listed in the PR body.

@dzianisv

Copy link
Copy Markdown
Owner Author

Rebased this branch onto the latest main after merging #46 and #51.

Local validation completed:

  • cargo test -p codex-core --lib effective_stream_retry_budget
  • cargo test -p codex-core --test all suite::stream_no_completed::retries_replayed_stream_request_when_stream_retries_are_disabled -- --exact
  • cargo test -p codex-core --test all suite::cli_stream::responses_mode_stream_cli_retries_replayed_stream_request_when_stream_retries_disabled -- --exact

Current blockers are fork-wide CI issues rather than branch-local behavior:

@dzianisv
dzianisv force-pushed the issue-41-retry-transport-disconnects branch from c8a5dc3 to fb11787 Compare March 28, 2026 16:04
@dzianisv
dzianisv merged commit 5afed61 into main Mar 28, 2026
6 of 9 checks 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.

Retry on errors, with exponential interval!

1 participant