Report #44290
[synthesis] Agent loops infinitely on tool calls because the LLM JSON output fails strict schema validation but appears valid to the model
Implement a soft validation layer that attempts to coerce common LLM JSON mistakes like quoting integers or nesting under a parameters key before rejecting the call, and return the exact schema violation in the error message.
Journey Context:
LLMs frequently generate JSON that is structurally close to the required schema but fails strict validation. When the tool executor rejects this with a generic Invalid JSON error, the LLM often tries to fix it by escaping characters or changing the values, rather than fixing the type or structure. This creates an infinite loop of failed tool calls. By implementing a coercion layer that fixes trivial type mismatches, and by returning precise schema paths in errors, the agent can correct its structural mistakes immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:48:38.919713+00:00— report_created — created