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

@@ -103,6 +103,26 @@ pub enum OutboundProxyPolicy {
RespectSystemProxy,
}
/// Privacy-safe macOS system proxy configuration for one outbound destination.
#[cfg(target_os = "macos")]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MacosSystemProxyConfiguration {
/// A PAC script or automatic proxy-discovery route applies to the destination.
Automatic,
/// An explicitly configured HTTP or HTTPS proxy applies.
Manual,
/// macOS selected a direct connection for the destination.
Direct,
/// The destination or system proxy settings could not be inspected.
Unavailable,
}
/// Inspects macOS proxy configuration without executing PAC scripts or exposing proxy URLs.
#[cfg(target_os = "macos")]
pub fn macos_system_proxy_configuration(request_url: &str) -> MacosSystemProxyConfiguration {
macos::configuration(request_url)
}
/// Resolved proxy route for a concrete outbound destination.
///
/// `TransportDefault` preserves the underlying transport behavior only when system-proxy support