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

@@ -13,6 +13,20 @@ use anyhow::Context;
use assert_cmd::prelude::*;
use codex_mcp_server::CodexToolCallParam;
// GitHub-hosted runners on every OS set the HTTP(S)_PROXY variables to a loopback MITM.
// When reqwest honours those settings it forwards requests using absolute-form URIs, which
// Wiremock does not match against simple path filters. We first saw the resulting flaky
// "expected request" assertions on Windows, but clearing the proxy variables keeps the
// local mock servers reachable across all runners.
const DISABLED_PROXY_ENV_VARS: &[&str] = &[
"ALL_PROXY",
"HTTP_PROXY",
"HTTPS_PROXY",
"all_proxy",
"http_proxy",
"https_proxy",
];
use mcp_types::CallToolRequestParams;
use mcp_types::ClientCapabilities;
use mcp_types::Implementation;
@@ -69,6 +83,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) => {