Improve codex doctor network diagnostics (#38918)

## What changed

- Probe the configured Responses inference endpoint with Codex's route-aware HTTP client, including configured proxy and custom CA behavior.
- Classify TLS, proxy authentication, proxy configuration, resolution, and timeout failures into actionable diagnostics.
- Report privacy-safe macOS system proxy state and suggest enabling `respect_system_proxy` when a configured proxy is otherwise unused.
- Preserve system-root fallback when a custom CA is invalid, and account for provider-specific API key configuration when selecting the probe route.

## Testing

- Cover inference endpoint selection, invalid custom CA fallback, proxy authentication failures, TLS classification, and macOS proxy reporting.

GitOrigin-RevId: c30a3ca5a332119e2b2f8c65341ef9b2251a28a2
This commit is contained in:
chess authored and copyberry committed 2026-08-17 00:09:44 +00:00
1 parent 772e88c8ae
commit c8ddb210d2
12 files changed
+677 -93

No files matched your search

@@ -64,6 +64,9 @@ fn spawn_http_listener(
Err(error) => panic!("HTTP listener should accept: {error}"),
}
};
stream
.set_nonblocking(false)
.expect("HTTP stream should become blocking");
stream
.set_read_timeout(Some(Duration::from_secs(10)))
.expect("HTTP stream should get a read timeout");
@@ -185,6 +188,15 @@ fn reqwest_default_route_preserves_transport_proxy_behavior() {
assert_eq!(route, OutboundProxyRoute::TransportDefault);
}
#[cfg(target_os = "macos")]
#[test]
fn macos_proxy_configuration_rejects_invalid_destination() {
assert_eq!(
macos_system_proxy_configuration("not a valid destination"),
MacosSystemProxyConfiguration::Unavailable
);
}
impl EnvSource for MapEnv {
fn var(&self, key: &str) -> Option<String> {
self.values.get(key).cloned()