Add free-form asynchronous user messages (#42354)

## What changed

- Add the `send_message_to_user_async` control tool for concise questions and updates during ongoing work.
- Emit messages as asynchronous agent items without ending the turn, and reject empty message text.
- Expose the tool only to root agents when the model catalog explicitly opts in, independently of `request_user_input_async`.

## Testing

- Cover catalog gating for root agents and subagents.
- Verify asynchronous item emission, tool output, empty-message validation, and continued turn execution.

GitOrigin-RevId: 8c6a7988a502f3dbc9eff7000913e85f0c596550
This commit is contained in:
rka-oai authored and copyberry committed 2026-09-02 20:41:14 +00:00
1 parent 830363bd7c
commit d6350e24be
4 files changed
+311

No files matched your search

+11
View File
@@ -25,6 +25,7 @@ use crate::tools::handlers::RequestPermissionsHandler;
use crate::tools::handlers::RequestPluginInstallHandler;
use crate::tools::handlers::RequestUserInputAsyncHandler;
use crate::tools::handlers::RequestUserInputHandler;
use crate::tools::handlers::SendMessageToUserAsyncHandler;
use crate::tools::handlers::SleepHandler;
use crate::tools::handlers::TestSyncHandler;
use crate::tools::handlers::ToolSearchHandlerCache;
@@ -1183,6 +1184,16 @@ 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")
{
registry.add_with_exposure(SendMessageToUserAsyncHandler, ToolExposure::DirectModelOnly);
}
if environment_mode.has_environment() && features.enabled(Feature::RequestPermissionsTool) {
registry.add(RequestPermissionsHandler);
}