mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
@@ -202,7 +202,7 @@ All agents in the team, including the agents that you can assign tasks to, are e
|
||||
You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task and trigger a turn, and `send_message` to pass a message to a running agent without triggering a turn.
|
||||
Child agents can also spawn their own sub-agents.
|
||||
You can decide how much context you want to propagate to your sub-agents with the `fork_turns` parameter.
|
||||
Default to doing the work yourself. Spawn sub-agents only for concrete, bounded subtasks that can run independently alongside useful local work and are likely to materially shorten completion time. Do not delegate simple tasks, small edits, routine searches, or work you can complete quickly yourself.
|
||||
Do not spawn sub-agents unless the user explicitly asks for sub-agents, delegation, or parallel agent work.
|
||||
|
||||
You will receive messages in the analysis channel in the form:
|
||||
```
|
||||
@@ -219,7 +219,7 @@ You can spawn sub-agents to handle subtasks, and those sub-agents can spawn thei
|
||||
|
||||
You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task and trigger a turn, and `send_message` to pass a message to a running agent.
|
||||
Child agents can also spawn their own sub-agents.
|
||||
Default to doing the work yourself. Spawn sub-agents only for concrete, bounded subtasks that can run independently alongside useful local work and are likely to materially shorten completion time. Do not delegate simple tasks, small edits, routine searches, or work you can complete quickly yourself.
|
||||
Do not spawn sub-agents unless the user explicitly asks for sub-agents, delegation, or parallel agent work.
|
||||
|
||||
When you provide a response in the final channel, that content is immediately delivered back to your parent agent.
|
||||
|
||||
|
||||
@@ -680,16 +680,9 @@ fn spawn_agent_tool_description(
|
||||
{tool_description}
|
||||
This spawn_agent tool provides you access to sub-agents that inherit your current model by default. Do not set the `model` field unless the user explicitly asks for a different model or there is a clear task-specific reason. 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.
|
||||
Do not spawn sub-agents unless the user explicitly asks for sub-agents, delegation, or parallel agent work.
|
||||
{agent_role_usage_hint}
|
||||
|
||||
### When to delegate vs. do the subtask yourself
|
||||
- First, quickly analyze the overall user task and form a succinct high-level plan. Identify which tasks are immediate blockers on the critical path, and which tasks are sidecar tasks that are needed but can run in parallel without blocking the next local step. As part of that plan, explicitly decide what immediate task you should do locally right now. Do this planning step before delegating to agents so you do not hand off the immediate blocking task to a submodel and then waste time waiting on it.
|
||||
- Use a subagent when a subtask is easy enough for it to handle and can run in parallel with your local work. Prefer delegating concrete, bounded sidecar tasks that materially advance the main task without blocking your immediate next local step.
|
||||
- Do not delegate urgent blocking work when your immediate next step depends on that result. If the very next action is blocked on that task, the main rollout should usually do it locally to keep the critical path moving.
|
||||
- Keep work local when the subtask is too difficult to delegate well and when it is tightly coupled, urgent, or likely to block your immediate next step.
|
||||
|
||||
### Designing delegated subtasks
|
||||
- Subtasks must be concrete, well-defined, and self-contained.
|
||||
- Delegated subtasks must materially advance the main task.
|
||||
|
||||
@@ -851,8 +851,11 @@ async fn tool_search_returns_deferred_v1_multi_agent_tools() -> Result<()> {
|
||||
.get("description")
|
||||
.and_then(Value::as_str)
|
||||
.expect("spawn_agent description should be present");
|
||||
assert!(description.contains("Only use `spawn_agent` if and only if"));
|
||||
assert!(description.contains(
|
||||
"Do not spawn sub-agents unless the user explicitly asks for sub-agents, delegation, or parallel agent work."
|
||||
));
|
||||
assert!(description.contains("### Designing delegated subtasks"));
|
||||
assert!(!description.contains("### When to delegate vs. do the subtask yourself"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -213,15 +213,13 @@ async fn spawn_agent_description_lists_visible_models_and_reasoning_efforts() ->
|
||||
);
|
||||
assert!(
|
||||
description.contains(
|
||||
"Only use `spawn_agent` if and only if the user explicitly asks for sub-agents, delegation, or parallel agent work."
|
||||
"Do not spawn sub-agents unless 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:?}"
|
||||
!description.contains("### When to delegate vs. do the subtask yourself"),
|
||||
"spawn_agent description should not include extra when-to-use delegation guidance: {description:?}"
|
||||
);
|
||||
assert!(
|
||||
description.contains(
|
||||
|
||||
Reference in New Issue
Block a user