From c1f4f1c821114461a6ed066ddfbbc7715458fa8f Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 1 Jun 2026 10:30:23 -0400 Subject: [PATCH] [codex] Don't propagate RUST_LOG to subprocesses by default Signed-off-by: William Woodruff --- codex-rs/protocol/src/shell_environment.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codex-rs/protocol/src/shell_environment.rs b/codex-rs/protocol/src/shell_environment.rs index 9edb91c2f3..5983574aaf 100644 --- a/codex-rs/protocol/src/shell_environment.rs +++ b/codex-rs/protocol/src/shell_environment.rs @@ -82,6 +82,12 @@ where EnvironmentVariablePattern::new_case_insensitive("*KEY*"), EnvironmentVariablePattern::new_case_insensitive("*SECRET*"), EnvironmentVariablePattern::new_case_insensitive("*TOKEN*"), + // Harnesses like Codex Desktop and the VS Code extension + // will spawn the app-server with `RUST_LOG=warn` by default, + // which can then cause unexpected behavior in subprocesses. + // This removes it by default; users can still explicitly + // include it via overrides. + EnvironmentVariablePattern::new("RUST_LOG"), ]; env_map.retain(|k, _| !matches_any(k, &default_excludes)); }