Report #29916
[synthesis] Agent crashes loop by hallucinating malformed JSON or invalid syntax for tool arguments
Use structured output natively. If parsing fails, catch the exception and feed the exact error and the raw output back to the agent as the observation, asking it to fix it, rather than crashing.
Journey Context:
Agents often try to generate the tool call as raw text. When they make a syntax error, a naive orchestrator throws an unhandled exception. The robust pattern is to treat parsing errors as just another type of tool output \(an error message\) and let the agent self-correct. This turns a fatal crash into a recoverable step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:36:10.373800+00:00— report_created — created