From b95cb23f84b87b17384e388189c432fb7eb61c18 Mon Sep 17 00:00:00 2001 From: starr-openai Date: Fri, 1 May 2026 00:41:03 +0000 Subject: [PATCH] Keep turn environment overrides turn-local Co-authored-by: Codex --- codex-rs/core/src/session/session.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/codex-rs/core/src/session/session.rs b/codex-rs/core/src/session/session.rs index 6dfaaf8ac6..f26c5848e8 100644 --- a/codex-rs/core/src/session/session.rs +++ b/codex-rs/core/src/session/session.rs @@ -208,9 +208,6 @@ impl SessionConfiguration { let cwd_changed = absolute_cwd.as_path() != self.cwd.as_path(); next_configuration.cwd = absolute_cwd.clone(); - if let Some(environments) = updates.environments.clone() { - next_configuration.environments = environments; - } if updates.environments.is_none() && cwd_changed && next_configuration.environments.len() == 1 @@ -315,8 +312,9 @@ pub(crate) struct SessionSettingsUpdate { pub(crate) reasoning_summary: Option, pub(crate) service_tier: Option>, pub(crate) final_output_json_schema: Option>, - /// Sticky environment selections for subsequent turns. `None` inherits - /// the current thread environments; `Some([])` explicitly disables them. + /// Turn-local environment override. `None` inherits the sticky thread + /// environments stored on `SessionConfiguration`; `Some([])` explicitly + /// disables environments for this turn. pub(crate) environments: Option>, pub(crate) personality: Option, pub(crate) app_server_client_name: Option,