mirror of
https://github.com/openai/codex.git
synced 2026-11-18 15:01:48 +00:00
chore: add minimal proxy egress diagnostics (#21220)
## Why Recent Auto Review reports show Git traffic hanging through the local proxy on both SSH and HTTPS paths. Today the support bundle does not make it obvious whether a request is stuck before upstream dialing, during the proxy hop, or after the upstream response begins, which slows down root-cause triage. This adds a small amount of runtime visibility at the existing proxy boundaries without changing routing or policy behavior. ## What changed - log whether HTTP and CONNECT traffic take the direct or upstream-proxy route - log start / success / failure timings for CONNECT, HTTP, and SOCKS5 upstream dials - log CONNECT forwarding lifecycle events - describe HTTP success at the response-header boundary that is actually observed, rather than implying the full body finished ## Verification - `cargo test -p codex-network-proxy` - `cargo clippy -p codex-network-proxy --all-targets -- -D warnings`
This commit is contained in:
1 parent
ed6082c9f9
commit
172303bbfa
3 files changed
+114
-25
No files matched your search
@@ -40,6 +40,7 @@ use std::io;
|
||||
use std::net::SocketAddr;
|
||||
use std::net::TcpListener as StdTcpListener;
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use tracing::error;
|
||||
use tracing::info;
|
||||
use tracing::warn;
|
||||
@@ -290,7 +291,20 @@ async fn handle_socks5_tcp(
|
||||
}
|
||||
}
|
||||
|
||||
tcp_connector.serve(req).await
|
||||
info!("SOCKS upstream dial started (host={host}, port={port})");
|
||||
let connect_started_at = Instant::now();
|
||||
let result = tcp_connector.serve(req).await;
|
||||
match &result {
|
||||
Ok(_) => info!(
|
||||
"SOCKS upstream dial established (host={host}, port={port}, elapsed_ms={})",
|
||||
connect_started_at.elapsed().as_millis()
|
||||
),
|
||||
Err(_) => warn!(
|
||||
"SOCKS upstream dial failed (host={host}, port={port}, elapsed_ms={})",
|
||||
connect_started_at.elapsed().as_millis()
|
||||
),
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
async fn inspect_socks5_udp(
|
||||
|
||||
Reference in new issue
Block a user