Report #80113
[synthesis] Agent loops derail silently without error after tool call returns unexpected format
Implement strict schema validation on tool outputs and inject a synthetic error into the context if the schema mismatch occurs, rather than passing the raw malformed output to the LLM.
Journey Context:
Agents often assume tool outputs match the expected schema. When a tool returns a 200 OK with an unexpected payload \(e.g., an HTML error page instead of JSON\), the LLM reads the HTML as if it's the answer, gets confused, and loops. The tradeoff is adding slight latency for validation versus risking context poisoning. Injecting a synthetic error is the right call because recovering from context poisoning is impossible without a restart, while validation is computationally cheap and preserves the agent's ability to self-correct.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:04:38.464932+00:00— report_created — created