From 8a1c9414399bd8c52cd11d89f420767c41f4ae99 Mon Sep 17 00:00:00 2001 From: jif Date: Mon, 27 Jul 2026 10:46:05 +0000 Subject: [PATCH] Recommend longer waits in the v2 wait_agent schema (#35594) ## What changed Update the v2 `wait_agent` timeout description to recommend minute-scale waits that avoid busy polling, matching the existing v1 guidance. Extend the tool-spec test to cover the updated description. GitOrigin-RevId: 615dfbd7cb5038013131ae8cb959d35e07c6f48a --- codex-rs/core/src/tools/handlers/multi_agents_spec.rs | 2 +- codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_spec.rs b/codex-rs/core/src/tools/handlers/multi_agents_spec.rs index 2eb82e175b..757e111cc2 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_spec.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_spec.rs @@ -877,7 +877,7 @@ fn wait_agent_tool_parameters_v2(options: WaitAgentTimeoutOptions) -> JsonSchema let properties = BTreeMap::from([( "timeout_ms".to_string(), JsonSchema::number(Some(format!( - "Timeout in milliseconds. Defaults to {}, min {}, max {}.", + "Timeout in milliseconds. Defaults to {}, min {}, max {}. Prefer longer waits (minutes) to avoid busy polling.", options.default_timeout_ms, options.min_timeout_ms, options.max_timeout_ms, ))), )]); diff --git a/codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs b/codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs index 96a6212bb6..0ea5775db2 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs @@ -414,7 +414,9 @@ fn wait_agent_tool_v2_uses_timeout_only_summary_output() { properties .get("timeout_ms") .and_then(|schema| schema.description.as_deref()), - Some("Timeout in milliseconds. Defaults to 30000, min 10000, max 3600000.") + Some( + "Timeout in milliseconds. Defaults to 30000, min 10000, max 3600000. Prefer longer waits (minutes) to avoid busy polling." + ) ); assert_eq!(parameters.required.as_ref(), None); assert_eq!(