Compare commits

...

1 Commits

Author SHA1 Message Date
Dylan
cb4884ec19 Clarify proxy clearing applies to all GitHub runners 2025-10-17 22:48:42 -07:00
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) => {

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) => {