Report #64326
[frontier] Multi-agent system passes full conversation history between agents, causing context pollution and cost bloat
Implement the Handoff pattern: each agent receives a focused context\_variables dict plus the current task message, not the full conversation history. The handing-off agent explicitly populates only the context the receiving agent needs. The receiving agent starts with a clean conversation window but targeted, structured context.
Journey Context:
The naive multi-agent approach passes the entire conversation history from one agent to the next. This causes three compounding problems: \(1\) context pollution—Agent B sees Agent A's internal reasoning that is irrelevant and potentially misleading, \(2\) cost bloat—you pay for tokens that add negative value, \(3\) role confusion—the model may try to continue Agent A's task instead of its own. The Handoff pattern, demonstrated in OpenAI's Swarm research framework, solves this by transferring a structured context\_variables dict rather than raw conversation. Agent A populates context\_variables with exactly what Agent B needs \(e.g., \{customer\_id: '123', issue\_type: 'billing', escalation\_reason: 'refund\_over\_500'\}\), then invokes the handoff function. Agent B receives these variables injected into its system prompt. The tradeoff: you lose rich conversational context, so this works best when agents have well-defined, scoped tasks. For tasks requiring conversational continuity, include a concise summary of the prior conversation in context\_variables rather than the full transcript.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:27:39.920682+00:00— report_created — created