From 44436fd0759249f47da8bfc41e6cae12af5b56ee Mon Sep 17 00:00:00 2001 From: jif Date: Wed, 22 Jul 2026 16:13:15 +0000 Subject: [PATCH] Reject dynamic environments named `local` (#34784) ## Why `local` identifies the environment owned by `EnvironmentManager`, but dynamic remote environment registration previously allowed that ID to be replaced. ## What changed Reject `local` in the shared environment ID validator used by dynamic remote environment registration. GitOrigin-RevId: 2622551f78989c16c432e6dd3d7da9bd8b0527c5 --- codex-rs/exec-server/src/environment.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/exec-server/src/environment.rs b/codex-rs/exec-server/src/environment.rs index 0f0cc4737b..4ac437c728 100644 --- a/codex-rs/exec-server/src/environment.rs +++ b/codex-rs/exec-server/src/environment.rs @@ -490,6 +490,11 @@ fn validate_environment_id(environment_id: &str) -> Result<(), ExecServerError> "environment id cannot be empty".to_string(), )); } + if environment_id == LOCAL_ENVIRONMENT_ID { + return Err(ExecServerError::Protocol(format!( + "environment id `{LOCAL_ENVIRONMENT_ID}` is reserved for EnvironmentManager" + ))); + } Ok(()) }