Resolve proxy routes for standalone web search redirects (#47204)

## Why

Standalone web search selected a proxy route only for the initial endpoint. Redirect destinations can require a different system proxy route.

## What changed

- Add `RouteAwareClientPool` support to `ReqwestTransport` for both buffered and streaming requests, and use it for standalone web search.
- Preserve default Codex headers and Cloudflare cookie handling across routes, while retaining the default client behavior when route-aware handling is disabled or Codex is sandboxed.
- Share request construction so URL authentication and header precedence follow `reqwest` semantics, applying them once before redirects and TLS retries.
- Map route-aware failures to transport errors and remove request URLs from those errors.

## Testing

Add regression coverage for redirects through distinct proxies, preservation of POST bodies and default headers, URL authentication and header precedence, and transport error classification without URL leakage.

GitOrigin-RevId: 19a10a62118846db09dd95265dc277e54aac09ef
This commit is contained in:
Celia Chen
2026-09-22 06:24:49 +00:00
committed by copyberry
parent b781733f95
commit 6ea62c4396
15 changed files with 654 additions and 77 deletions
-1
View File
@@ -30,5 +30,4 @@ pub use responses_websocket::ResponsesWebsocketClient;
pub use responses_websocket::ResponsesWebsocketClose;
pub use responses_websocket::ResponsesWebsocketConnection;
pub use responses_websocket::ResponsesWebsocketProbe;
pub use search::SEARCH_ENDPOINT;
pub use search::SearchClient;
+1 -1
View File
@@ -12,7 +12,7 @@ use serde_json::to_value;
use std::sync::Arc;
/// The provider-relative endpoint for standalone web search.
pub const SEARCH_ENDPOINT: &str = "alpha/search";
const SEARCH_ENDPOINT: &str = "alpha/search";
pub struct SearchClient<T: HttpTransport> {
session: EndpointSession<T>,
-1
View File
@@ -70,7 +70,6 @@ pub use crate::endpoint::ResponsesWebsocketClient;
pub use crate::endpoint::ResponsesWebsocketClose;
pub use crate::endpoint::ResponsesWebsocketConnection;
pub use crate::endpoint::ResponsesWebsocketProbe;
pub use crate::endpoint::SEARCH_ENDPOINT;
pub use crate::endpoint::SearchClient;
pub use crate::endpoint::session_update_session_json;
pub use crate::error::ApiError;