From 41efc6333e3ed476ce824aa729656f97503c10b8 Mon Sep 17 00:00:00 2001 From: sayan-oai Date: Thu, 16 Jul 2026 16:07:08 +0000 Subject: [PATCH] Clarify when to wait for starting environments (#33633) ## What changed - Tell the model to call `wait_for_environment` only when a task needs the selected environment's files, commands, or installed capabilities. - Document that waiting can take several minutes and blocks other tool calls, and direct the model to continue if startup fails. - Require the exact `starting` environment ID shown in ``. GitOrigin-RevId: 6b434b835d379318879d5499c365c70598673afd --- codex-rs/core/src/tools/handlers/wait_for_environment.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/tools/handlers/wait_for_environment.rs b/codex-rs/core/src/tools/handlers/wait_for_environment.rs index c9103521c19..8cdaf34aa3a 100644 --- a/codex-rs/core/src/tools/handlers/wait_for_environment.rs +++ b/codex-rs/core/src/tools/handlers/wait_for_environment.rs @@ -34,7 +34,7 @@ impl ToolExecutor for WaitForEnvironmentHandler { fn spec(&self) -> ToolSpec { ToolSpec::Function(ResponsesApiTool { name: WAIT_FOR_ENVIRONMENT_TOOL_NAME.to_string(), - description: "Wait for a starting environment to become available before continuing." + description: "Wait for a selected execution environment marked as `starting` to become available. Use this when the current task needs that environment's files, commands, or installed capabilities. Do not wait if the task can be completed using tools already available, such as connectors. Waiting may take several minutes and blocks other tool calls. If startup fails, continue without that environment." .to_string(), strict: false, defer_loading: None, @@ -42,7 +42,8 @@ impl ToolExecutor for WaitForEnvironmentHandler { BTreeMap::from([( "environment_id".to_string(), JsonSchema::string(Some( - "The id of an environment currently marked as starting.".to_string(), + "The exact environment ID marked as `starting` in ``." + .to_string(), )), )]), /*required*/ Some(vec!["environment_id".to_string()]),