From 5e41303911f0062d42147a01ede153b262e7dfcc Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 8 Sep 2025 18:47:39 -0700 Subject: [PATCH] timestamp --- codex-rs/core/src/default_client.rs | 11 ---------- codex-rs/core/tests/suite/client.rs | 20 ------------------- .../core/tests/suite/fork_conversation.rs | 4 ---- codex-rs/core/tests/suite/prompt_caching.rs | 20 ------------------- 4 files changed, 55 deletions(-) diff --git a/codex-rs/core/src/default_client.rs b/codex-rs/core/src/default_client.rs index 3fec4b307d..d274351779 100644 --- a/codex-rs/core/src/default_client.rs +++ b/codex-rs/core/src/default_client.rs @@ -27,8 +27,6 @@ pub fn create_client(originator: &str) -> reqwest::Client { match reqwest::Client::builder() // Set UA via dedicated helper to avoid header validation pitfalls .user_agent(ua) - // Avoid touching macOS SystemConfiguration proxies in sandboxed tests - .no_proxy() .default_headers(headers) .build() { @@ -49,15 +47,6 @@ mod tests { #[tokio::test] async fn test_create_client_sets_default_headers() { - if std::env::var("CODEX_SANDBOX").is_ok() - || std::env::var("CODEX_SANDBOX_NETWORK_DISABLED") - .ok() - .as_deref() - == Some("1") - { - // In sandboxed environments, binding a local port may be denied. - return; - } use wiremock::Mock; use wiremock::MockServer; use wiremock::ResponseTemplate; diff --git a/codex-rs/core/tests/suite/client.rs b/codex-rs/core/tests/suite/client.rs index f9ab6cd55c..1aa1a49de7 100644 --- a/codex-rs/core/tests/suite/client.rs +++ b/codex-rs/core/tests/suite/client.rs @@ -316,10 +316,6 @@ async fn includes_conversation_id_and_model_headers_in_request() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn includes_base_instructions_override_in_request() { - if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } // Mock server let server = MockServer::start().await; @@ -377,10 +373,6 @@ async fn includes_base_instructions_override_in_request() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn originator_config_override_is_used() { - if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } // Mock server let server = MockServer::start().await; @@ -662,10 +654,6 @@ async fn prefers_apikey_when_config_prefers_apikey_even_with_chatgpt_tokens() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn includes_user_instructions_message_in_request() { - if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } let server = MockServer::start().await; let first = ResponseTemplate::new(200) @@ -727,10 +715,6 @@ async fn includes_user_instructions_message_in_request() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn azure_overrides_assign_properties_used_for_responses_url() { - if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } let existing_env_var_with_random_value = if cfg!(windows) { "USERNAME" } else { "USER" }; // Mock server @@ -807,10 +791,6 @@ async fn azure_overrides_assign_properties_used_for_responses_url() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn env_var_overrides_loaded_auth() { - if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } let existing_env_var_with_random_value = if cfg!(windows) { "USERNAME" } else { "USER" }; // Mock server diff --git a/codex-rs/core/tests/suite/fork_conversation.rs b/codex-rs/core/tests/suite/fork_conversation.rs index ba21b30d1f..92e43dbfeb 100644 --- a/codex-rs/core/tests/suite/fork_conversation.rs +++ b/codex-rs/core/tests/suite/fork_conversation.rs @@ -23,10 +23,6 @@ fn sse_completed(id: &str) -> String { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn fork_conversation_twice_drops_to_first_message() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } // Start a mock server that completes three turns. let server = MockServer::start().await; let sse = sse_completed("resp"); diff --git a/codex-rs/core/tests/suite/prompt_caching.rs b/codex-rs/core/tests/suite/prompt_caching.rs index e49478abcf..4625841a64 100644 --- a/codex-rs/core/tests/suite/prompt_caching.rs +++ b/codex-rs/core/tests/suite/prompt_caching.rs @@ -42,10 +42,6 @@ fn assert_tool_names(body: &serde_json::Value, expected_names: &[&str]) { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn codex_mini_latest_tools() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } use pretty_assertions::assert_eq; let server = MockServer::start().await; @@ -130,10 +126,6 @@ async fn codex_mini_latest_tools() { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn prompt_tools_are_consistent_across_requests() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } use pretty_assertions::assert_eq; let server = MockServer::start().await; @@ -217,10 +209,6 @@ async fn prompt_tools_are_consistent_across_requests() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn prefixes_context_and_instructions_once_and_consistently_across_requests() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } use pretty_assertions::assert_eq; let server = MockServer::start().await; @@ -339,10 +327,6 @@ async fn prefixes_context_and_instructions_once_and_consistently_across_requests #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn overrides_turn_context_but_keeps_cached_prefix_and_key_constant() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } use pretty_assertions::assert_eq; let server = MockServer::start().await; @@ -464,10 +448,6 @@ async fn overrides_turn_context_but_keeps_cached_prefix_and_key_constant() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn per_turn_overrides_keep_cached_prefix_and_key_constant() { - if std::env::var(codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() { - eprintln!("Skipping network-bound test in sandbox"); - return; - } use pretty_assertions::assert_eq; let server = MockServer::start().await;