Report #67564
[architecture] Unstructured text passed between agents causes cascading parsing failures and hallucinated tool calls
Enforce strict JSON Schema contracts \(e.g., via Pydantic or Zod\) at agent boundaries, treating inter-agent communication like microservice API contracts. Reject non-conforming outputs and force a retry with the schema validation error as feedback.
Journey Context:
Developers often rely on natural language handoffs because LLMs excel at text. However, slight phrasing variations cause the receiving agent to misinterpret context or fail tool invocations. Alternatives like 'prompting for clear separation' are brittle. Strict schema validation introduces coupling but guarantees structural integrity, turning stochastic text generation into a deterministic API boundary. If validation fails, feeding the exact Pydantic ValidationError back to the generator agent often corrects the output on the next attempt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:53:17.747062+00:00— report_created — created