mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Clarify spawn agent authorization (#14432)
- Clarify that spawn_agent requires explicit user permission for delegation or parallel agent work. - Add a regression test covering the new description text.
This commit is contained in:
committed by
GitHub
Unverified
parent
ba5b94287e
commit
367a8a2210
@@ -853,7 +853,10 @@ fn create_spawn_agent_tool(config: &ToolsConfig) -> ToolSpec {
|
||||
name: "spawn_agent".to_string(),
|
||||
description: format!(
|
||||
r#"
|
||||
Only use `spawn_agent` if and only if the user explicitly asked for sub-agents or parallel agent work. Spawn a sub-agent for a well-scoped task. Returns the agent id (and user-facing nickname when available) to use to communicate with this agent. This spawn_agent tool provides you access to smaller but more efficient sub-agents. A mini model can solve many tasks faster than the main model. You should follow the rules and guidelines below to use this tool.
|
||||
Only use `spawn_agent` if and only if the user explicitly asks for sub-agents, delegation, or parallel agent work.
|
||||
Requests for depth, thoroughness, research, investigation, or detailed codebase analysis do not count as permission to spawn.
|
||||
Agent-role guidance below only helps choose which agent to use after spawning is already authorized; it never authorizes spawning by itself.
|
||||
Spawn a sub-agent for a well-scoped task. Returns the agent id (and user-facing nickname when available) to use to communicate with this agent. This spawn_agent tool provides you access to smaller but more efficient sub-agents. A mini model can solve many tasks faster than the main model. You should follow the rules and guidelines below to use this tool.
|
||||
|
||||
{available_models_description}
|
||||
### When to delegate vs. do the subtask yourself
|
||||
|
||||
@@ -180,6 +180,24 @@ async fn spawn_agent_description_lists_visible_models_and_reasoning_efforts() ->
|
||||
!description.contains("Hidden Model"),
|
||||
"hidden picker model should be omitted from spawn_agent description: {description:?}"
|
||||
);
|
||||
assert!(
|
||||
description.contains(
|
||||
"Only use `spawn_agent` if and only if the user explicitly asks for sub-agents, delegation, or parallel agent work."
|
||||
),
|
||||
"expected explicit authorization rule in spawn_agent description: {description:?}"
|
||||
);
|
||||
assert!(
|
||||
description.contains(
|
||||
"Requests for depth, thoroughness, research, investigation, or detailed codebase analysis do not count as permission to spawn."
|
||||
),
|
||||
"expected non-authorization clarification in spawn_agent description: {description:?}"
|
||||
);
|
||||
assert!(
|
||||
description.contains(
|
||||
"Agent-role guidance below only helps choose which agent to use after spawning is already authorized; it never authorizes spawning by itself."
|
||||
),
|
||||
"expected agent-role clarification in spawn_agent description: {description:?}"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user