Add a feature flag for asynchronous user messages (#45124)

## What changed

Add the disabled-by-default `send_message_to_user_async` feature flag so root agents can use the tool without model catalog support. Preserve catalog-based opt-in and keep the tool unavailable to subagents. Register the flag as under development and expose it in the configuration schema.

## Testing

Extend integration tests to cover feature and catalog opt-ins, deduplication when both are enabled, subagent exclusion, and the retired `send_async_message` flag. Check that either opt-in allows messages to be emitted without ending the turn.

GitOrigin-RevId: 3f53181ab074b0432c795550de73a9b1da7caf15
This commit is contained in:
alishobeiri-oai authored and copyberry committed 2026-09-12 22:28:41 +00:00
1 parent 70eb36203d
commit b979d4f1f0
4 files changed
+63 -19

No files matched your search

+6 -5
View File
@@ -1190,11 +1190,12 @@ fn add_core_utility_tools(context: &CoreToolPlanContext<'_>, registry: &mut Tool
}
if !turn_context.session_source.is_non_root_agent()
&& context
.model_info
.experimental_supported_tools
.iter()
.any(|tool| tool == "send_message_to_user_async")
&& (features.enabled(Feature::SendMessageToUserAsync)
|| context
.model_info
.experimental_supported_tools
.iter()
.any(|tool| tool == "send_message_to_user_async"))
{
registry.add_with_exposure(SendMessageToUserAsyncHandler, ToolExposure::DirectModelOnly);
}