From f39325c846c04e6be89b2d0fe8e9ae6869ce4403 Mon Sep 17 00:00:00 2001 From: tanyar09 Date: Thu, 5 Mar 2026 15:27:25 -0500 Subject: [PATCH] Fix spawn tool: clarify that task parameter must be natural language, not tool call syntax --- nanobot/agent/tools/spawn.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nanobot/agent/tools/spawn.py b/nanobot/agent/tools/spawn.py index 5884a07..1641f71 100644 --- a/nanobot/agent/tools/spawn.py +++ b/nanobot/agent/tools/spawn.py @@ -35,7 +35,16 @@ class SpawnTool(Tool): return ( "Spawn a subagent to handle a task in the background. " "Use this for complex or time-consuming tasks that can run independently. " - "The subagent will complete the task and report back when done." + "The subagent will complete the task and report back when done.\n\n" + "CRITICAL: The 'task' parameter MUST be a natural language description of what to do, " + "NOT a tool call. The subagent will figure out how to accomplish the task using its own tools.\n\n" + "CORRECT examples:\n" + "- task='Read all documentation files in the project and create a summary'\n" + "- task='Analyze the codebase structure and generate a report'\n" + "- task='Search for information about X and compile findings'\n\n" + "WRONG (do not use tool call syntax):\n" + "- task='read_dir(path=\"/path/to/file\")' ❌\n" + "- task='read_file(path=\"file.txt\")' ❌" ) @property @@ -45,7 +54,12 @@ class SpawnTool(Tool): "properties": { "task": { "type": "string", - "description": "The task for the subagent to complete", + "description": ( + "A natural language description of the task for the subagent to complete. " + "DO NOT use tool call syntax. Examples: 'Read all documentation and summarize', " + "'Analyze the codebase structure', 'Search the web for X and compile findings'. " + "The subagent will determine which tools to use to accomplish this task." + ), }, "label": { "type": "string",