Clarify proxy clearing applies to all GitHub runners

This commit is contained in:
Dylan
2025-10-17 22:48:42 -07:00
parent 6915ba2100
commit cb4884ec19
2 changed files with 36 additions and 0 deletions

View File

@@ -39,6 +39,20 @@ use codex_app_server_protocol::RequestId;
use std::process::Command as StdCommand;
use tokio::process::Command;
// GitHub-hosted runners on every OS export HTTP proxy variables that point at a
// loopback MITM. Reqwest obeys those settings and will emit absolute-form URIs,
// which Wiremock does not match against simple path predicates. We first noticed
// the resulting "expected request" flakes on Windows, but we clear the proxy
// variables everywhere so the tests behave consistently across runners.
const DISABLED_PROXY_ENV_VARS: &[&str] = &[
"ALL_PROXY",
"HTTP_PROXY",
"HTTPS_PROXY",
"all_proxy",
"http_proxy",
"https_proxy",
];
pub struct McpProcess {
next_request_id: AtomicI64,
/// Retain this child process until the client is dropped. The Tokio runtime
@@ -79,6 +93,10 @@ impl McpProcess {
cmd.env("CODEX_HOME", codex_home);
cmd.env("RUST_LOG", "debug");
for proxy_env in DISABLED_PROXY_ENV_VARS {
cmd.env_remove(proxy_env);
}
for (k, v) in env_overrides {
match v {
Some(val) => {