From c9534ef6f95d6c3397a605544caec1eae884a900 Mon Sep 17 00:00:00 2001 From: chengyongru Date: Wed, 1 Jul 2026 13:47:24 +0800 Subject: [PATCH] docs(agent): guide mapreduce subagent outputs --- nanobot/agent/tools/spawn.py | 3 +++ nanobot/templates/agent/subagent_system.md | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/nanobot/agent/tools/spawn.py b/nanobot/agent/tools/spawn.py index 420afc048..6ef0a81ad 100644 --- a/nanobot/agent/tools/spawn.py +++ b/nanobot/agent/tools/spawn.py @@ -63,6 +63,9 @@ class SpawnTool(Tool, ContextAware): return ( "Spawn a subagent to handle a task in the background. " "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. " "For deliverables or existing projects, inspect the workspace first " "and use a dedicated subdirectory when helpful." diff --git a/nanobot/templates/agent/subagent_system.md b/nanobot/templates/agent/subagent_system.md index 5d9d16c0c..6d98d9e1c 100644 --- a/nanobot/templates/agent/subagent_system.md +++ b/nanobot/templates/agent/subagent_system.md @@ -4,6 +4,15 @@ 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. +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' %}