Report #24375
[frontier] Agent router hallucinates target agent names or creates infinite delegation loops
Replace string-based routing \('transfer\_to\_agent\_A'\) with structured Handoff objects containing \`to\_agent\` \(enum\) and \`payload\` fields. Implement a visited-set check in the orchestrator to prevent cycles \(e.g., max 3 handoffs\), and validate handoff targets against a strict registry.
Journey Context:
Early multi-agent systems used function calling where the LLM output a string like 'transfer\_to\_billing\_agent'. This fails because LLMs hallucinate agent names or parameters, and lack type safety. OpenAI's Agents SDK and similar frameworks now use explicit Handoff objects that are strongly typed. The journey from 'function calling as routing' to 'handoff primitives' separates control flow from business logic. Naive implementations also allow A→B→A loops; the fix is treating handoffs as a state graph with cycle detection, not a free-for-all message bus.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:19:30.296019+00:00— report_created — created