mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Retry bootstrap GETs through the system proxy after request failures (#52702)
## Why Account discovery and cloud configuration GETs can fail after connecting but before receiving response headers. These request failures previously bypassed system proxy fallback. ## What changed Allow bootstrap GETs to retry through the system proxy on request errors, alongside the existing connection failure and timeout cases, when fallback is enabled. ## Testing Add regression coverage for connections closed before response headers on `accounts/check` and `config/bundle`, verifying successful proxy retries with the original request headers. Extend coverage to ensure HTTP responses with status `401`, `403`, `407`, `429`, or `503` do not trigger fallback, and network policy denials prevent requests to both the origin and proxy. GitOrigin-RevId: ac34c3bcfe3bd81c905a7e616d8b821879fbe2c9
This commit is contained in:
@@ -360,7 +360,9 @@ impl Client {
|
||||
Ok(Err(RequestError::Other(error)))
|
||||
if error
|
||||
.downcast_ref::<RouteAwareRequestError>()
|
||||
.is_some_and(|error| error.is_connect() || error.is_timeout()) => {}
|
||||
.is_some_and(|error| {
|
||||
error.is_connect() || error.is_timeout() || error.is_request()
|
||||
}) => {}
|
||||
Err(_) => {}
|
||||
Ok(response) => return response,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user