feat(subagent): use report_back tool for announcing results#890
feat(subagent): use report_back tool for announcing results#890tyler6204 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
02407db to
67de444
Compare
- Add report_back tool for subagents to send results to main session - Subagents now get full context (workspace files, tools, skills, etc.) - Remove secondary announce step - subagent handles its own reporting - Update tool policy: deny sessions_send, sessions_spawn, message - Allow sessions_list and sessions_history (read-only) - Add internalOnly option to report_back for silent tasks - Update docs to reflect new architecture Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Each new tool adds complexity and needs more token - do we really need this? |
|
the announce tool wasn't working so this PR fixes that. but re the broader question of subagent purpose, my use case is parallel task execution without blocking main chat. yesterday i spun up 6 subagents (2 skill creations then 4 verification agents) simultaneously while continuing to chat. the issue without context is subagents get stuck in loops trying to discover things like notion api quirks that are already in TOOLS.md. they burn more tokens searching my system for the 'right way' vs just having that context upfront. so counterintuitively, giving them SOUL.md + TOOLS.md actually saves tokens. happy to discuss if subagents are meant for a different use case but for parallel non-blocking work, context is essential |
|
I'm not sure subagents need a Soul or charcters, I see them as worker bees, they don't need to be sassy. |
Summary
Refactors subagent architecture to use a dedicated
report_backtool instead of a secondary announce step. Subagents now have full control over when and how they report results.Changes
report_backtool - Subagents call this to send results back to main sessioninternalOnly: trueoption for silent/internal taskssessions_send(use report_back instead)sessions_spawn(prevents infinite loops)message(use report_back instead)sessions_listandsessions_historydocs/tools/subagents.mdreflects new architectureFiles
src/agents/tools/report-back-tool.ts- New tool for subagent reportingsrc/agents/subagent-announce.ts- Expanded system prompt, added cleanup functionsrc/agents/subagent-registry.ts- Calls cleanup instead of announce flowsrc/agents/tools/sessions-spawn-tool.ts- Loads full context for subagentssrc/agents/clawdbot-tools.ts- Adds report_back tool for subagent sessionssrc/agents/pi-tools.ts- Updated DEFAULT_SUBAGENT_TOOL_DENYdocs/tools/subagents.md- Updated documentationTest plan
🤖 Generated with Claude Code