mirror of
https://github.com/openai/codex.git
synced 2026-05-05 05:42:33 +03:00
feat: add agent roles to collab tools (#9275)
Add `agent_type` parameter to the collab tool `spawn_agent` that contains a preset to apply on the config when spawning this agent
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::agent::AgentRole;
|
||||
use crate::client_common::tools::ResponsesApiTool;
|
||||
use crate::client_common::tools::ToolSpec;
|
||||
use crate::features::Feature;
|
||||
@@ -441,6 +442,15 @@ fn create_spawn_agent_tool() -> ToolSpec {
|
||||
description: Some("Initial message to send to the new agent.".to_string()),
|
||||
},
|
||||
);
|
||||
properties.insert(
|
||||
"agent_type".to_string(),
|
||||
JsonSchema::String {
|
||||
description: Some(format!(
|
||||
"Optional agent type to spawn ({}).",
|
||||
AgentRole::enum_values().join(", ")
|
||||
)),
|
||||
},
|
||||
);
|
||||
|
||||
ToolSpec::Function(ResponsesApiTool {
|
||||
name: "spawn_agent".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user