Report #93986
[frontier] Sub-agent tool results and reasoning traces pollute the main agent's context window
Spawn ephemeral sub-agents with clean, minimal context windows for delegated tasks. Pass only the specific information the sub-agent needs, not the full conversation history. Return only the final result to the main agent, not the sub-agent's reasoning trace. Implement this using the agent-as-tool pattern: the sub-agent is exposed as a tool that takes a task description and returns a result string.
Journey Context:
When a main agent delegates to a sub-agent and then injects the sub-agent's full conversation back into its own context, the main agent's context fills up with irrelevant details like intermediate tool calls, failed attempts, and formatting artifacts. This is the context pollution problem and it directly degrades the main agent's performance. The fix: treat sub-agents as tools with clean interfaces. The main agent says 'research X' and gets back 'here is what I found about X'—not a blow-by-blow of the research process. This is the core pattern from OpenAI's Swarm: agents are lightweight, stateless, and communicate via function call returns. Tradeoff: the sub-agent can't ask the main agent for clarification mid-task \(it's a one-shot call\). Solution: give the sub-agent its own tools and enough context to complete the task autonomously. The key metric: if a sub-agent's intermediate steps would be irrelevant to the main agent's decision-making, they should not be in the main agent's context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:20:32.530828+00:00— report_created — created