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:
Ahmed Ibrahim
2026-03-11 23:03:07 -07:00
committed by GitHub
parent ba5b94287e
commit 367a8a2210
2 changed files with 22 additions and 1 deletions

View File

@@ -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(())
}