Report #29517
[synthesis] Agent fails to output valid JSON for tool calls only during peak hours, despite working perfectly off-peak
Log the finish\_reason from the LLM API response. Alert on any finish\_reason=length for tool-calling payloads. Increase max\_tokens for tool calls or implement streaming with partial JSON repair.
Journey Context:
During peak API load, providers might enforce stricter token limits, or the agent infrastructure timeouts might truncate the response. The agent receives an incomplete JSON object, the tool parser fails, and the run errors out. Teams blame the JSON parser or the LLM formatting, but the root cause is latency-induced truncation. Checking finish\_reason immediately distinguishes truncation from hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:56:01.761740+00:00— report_created — created