Skip to content

fix(retry): treat request-level errors as retryable#2543

Merged
tusharmath merged 2 commits intomainfrom
fix/retry-unexpected-eof
Mar 12, 2026
Merged

fix(retry): treat request-level errors as retryable#2543
tusharmath merged 2 commits intomainfrom
fix/retry-unexpected-eof

Conversation

@tusharmath
Copy link
Collaborator

@tusharmath tusharmath commented Mar 12, 2026

Summary

Treat request-level reqwest errors as retryable, fixing the peer closed connection without sending TLS close_notify error from the ChatGPT codex endpoint.

Context

Requests to https://chatgpt.com/backend-api/codex/responses were failing permanently with:

peer closed connection without sending TLS close_notify

This error surfaces as a reqwest::Error with is_request() == true. The existing retry check only covered is_timeout() and is_connect(), so these request-level transport failures were never retried.

Changes

  • Added || e.is_request() to is_req_transport_error — a one-line fix
  • Added one test that simulates a peer dropping the connection and verifies it's retried

Testing

cargo insta test --accept -p forge_repo

Links

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant