Allow hosts to customize wait_for_environment descriptions (#35106)

## What changed

- Add `WaitForEnvironmentToolConfig` as thread extension data for overriding the
  model-visible tool and `environment_id` descriptions.
- Preserve the default descriptions when no override is provided or when the
  configured descriptions exceed the input or serialized tool-spec limits.
- Keep `wait_for_environment` availability gated by the deferred executor
  feature independently of whether a host override is present.

## Testing

- Cover default, custom, oversized, and feature-disabled tool configurations.
- Verify the custom descriptions in the deferred-environment integration flow.

GitOrigin-RevId: 6b49a73a434becd99ea5df911be53f3706a17c0a
This commit is contained in:
TAFOYA-OAI authored and copyberry committed 2026-07-24 06:03:36 +00:00
1 parent a28374e0db
commit 81da9deb06
12 files changed
+317 -42

No files matched your search

+5
View File
@@ -120,6 +120,7 @@ async fn parallel_support_does_not_match_namespaced_local_tool_names() -> anyhow
tool_suggest_candidates: None,
tool_runtimes: Vec::new(),
extension_tool_executors: Vec::new(),
wait_for_environment_tool_config: None,
dynamic_tools: turn.dynamic_tools.as_slice(),
},
&Default::default(),
@@ -233,6 +234,7 @@ async fn mcp_parallel_support_uses_handler_data() -> anyhow::Result<()> {
)),
],
extension_tool_executors: Vec::new(),
wait_for_environment_tool_config: None,
dynamic_tools: turn.dynamic_tools.as_slice(),
},
&Default::default(),
@@ -272,6 +274,7 @@ async fn tools_without_handlers_do_not_support_parallel() -> anyhow::Result<()>
tool_suggest_candidates: None,
tool_runtimes: Vec::new(),
extension_tool_executors: Vec::new(),
wait_for_environment_tool_config: None,
dynamic_tools: turn.dynamic_tools.as_slice(),
},
&Default::default(),
@@ -330,6 +333,7 @@ async fn specs_filter_deferred_dynamic_tools() -> anyhow::Result<()> {
tool_suggest_candidates: None,
tool_runtimes: Vec::new(),
extension_tool_executors: Vec::new(),
wait_for_environment_tool_config: None,
dynamic_tools: &dynamic_tools,
},
&Default::default(),
@@ -407,6 +411,7 @@ async fn extension_tool_executors_are_model_visible_and_dispatchable() -> anyhow
tool_suggest_candidates: None,
tool_runtimes: Vec::new(),
extension_tool_executors: extension_tool_executors(&session),
wait_for_environment_tool_config: None,
dynamic_tools: turn.dynamic_tools.as_slice(),
},
&Default::default(),