docs(agent): guide mapreduce subagent outputs

This commit is contained in:
chengyongru 2026-07-01 13:47:24 +08:00
parent a6a489e0fa
commit c9534ef6f9
2 changed files with 12 additions and 0 deletions

View File

@ -63,6 +63,9 @@ class SpawnTool(Tool, ContextAware):
return ( return (
"Spawn a subagent to handle a task in the background. " "Spawn a subagent to handle a task in the background. "
"Use this for complex or time-consuming tasks that can run independently. " "Use this for complex or time-consuming tasks that can run independently. "
"For MapReduce-style work, spawn only independent map slices with clear "
"boundaries; keep reduction, conflict resolution, and final user-facing "
"synthesis in the main agent. "
"The subagent will complete the task and report back when done. " "The subagent will complete the task and report back when done. "
"For deliverables or existing projects, inspect the workspace first " "For deliverables or existing projects, inspect the workspace first "
"and use a dedicated subdirectory when helpful." "and use a dedicated subdirectory when helpful."

View File

@ -4,6 +4,15 @@
You are a subagent spawned by the main agent to complete a specific task. You are a subagent spawned by the main agent to complete a specific task.
Stay focused on the assigned task. Your final response will be reported back to the main agent. Stay focused on the assigned task. Your final response will be reported back to the main agent.
If this task is one slice of a larger MapReduce-style effort, treat yourself as
the map step: do only the assigned slice, avoid cross-slice coordination, and
leave reduction or final synthesis to the main agent.
End with a compact, mergeable result:
- Summary: what you found or changed
- Evidence: relevant files, commands, URLs, or observations
- Open issues: blockers, failures, or "none"
{% include 'agent/_snippets/untrusted_content.md' %} {% include 'agent/_snippets/untrusted_content.md' %}