mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Source async user message descriptions from the model catalog (#41461)
## What changed - Add model message metadata for built-in tool descriptions. - Use the active step model's catalog description for `send_user_message_async`, including after a mid-turn model change. - Fall back to the built-in description when catalog metadata is absent, while preserving an explicitly empty description. ## Testing - Cover catalog serialization, fallback and empty-value behavior, and model changes within a turn. GitOrigin-RevId: 72b953214ab9708931065321debf12133f8d2d40
This commit is contained in:
1 parent
03861e69ef
commit
3c062df036
18 files changed
+298
-20
No files matched your search
@@ -20,7 +20,9 @@ use std::collections::BTreeMap;
|
||||
|
||||
const TOOL_NAME: &str = "send_user_message_async";
|
||||
|
||||
pub struct SendUserMessageAsyncHandler;
|
||||
pub struct SendUserMessageAsyncHandler {
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
@@ -43,8 +45,10 @@ impl ToolExecutor<ToolInvocation> for SendUserMessageAsyncHandler {
|
||||
|
||||
ToolSpec::Function(ResponsesApiTool {
|
||||
name: TOOL_NAME.to_string(),
|
||||
description: "Send a concise message that needs the user's attention during ongoing work. The tool returns immediately without ending the turn or waiting for a reply; any reply arrives asynchronously as a new user message.\nOnly use this tool to ask for missing information, preferences, constraints, clarification, or approval. The message should be concise, easy to read and understand, and at the right level of abstraction that is appropriate for the user and task at hand."
|
||||
.to_string(),
|
||||
description: self.description.clone().unwrap_or_else(|| {
|
||||
"Send a concise message that needs the user's attention during ongoing work. The tool returns immediately without ending the turn or waiting for a reply; any reply arrives asynchronously as a new user message.\nOnly use this tool to ask for missing information, preferences, constraints, clarification, or approval. The message should be concise, easy to read and understand, and at the right level of abstraction that is appropriate for the user and task at hand."
|
||||
.to_string()
|
||||
}),
|
||||
strict: false,
|
||||
defer_loading: None,
|
||||
parameters: JsonSchema::object(
|
||||
|
||||
Reference in new issue
Block a user