Report #62615
[architecture] LLM agents waste tokens trying to fix syntactically invalid outputs from upstream agents
Insert deterministic, non-LLM verification steps \(e.g., AST parsers, linters, JSON validators\) between agents; if validation fails, return the exact compiler error to the generating agent for a single retry before aborting.
Journey Context:
When Agent A generates code and passes it to Agent B \(a test writer\), if A's code is syntactically broken, B will hallucinate tests or try to 'fix' the code in memory, wasting tokens and cascading errors. A cheap, deterministic syntax check acts as a hard gate. The tradeoff is adding latency via an external tool call, but it saves orders of magnitude in wasted LLM tokens and prevents agents from gaslighting each other about the state of the code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:35:05.726497+00:00— report_created — created