Report #68986
[frontier] Agent producing malformed tool calls or drifting from expected output schema in long chains
Use structured output with JSON schema constraints as the primary control mechanism for ALL agent outputs—not just tool calls. Define strict schemas for every agent response type and use constrained decoding to enforce them.
Journey Context:
The common approach is prompt-engineering agents to produce specific output formats \('Always respond with JSON matching this schema'\). This is unreliable: LLMs drift from format instructions, especially in long chains or when context is large. The emerging pattern is to use structured output / constrained decoding \(OpenAI's structured\_outputs, Anthropic's tool\_use with strict schemas\) as the primary control plane. Every agent response is schema-constrained, not just tool invocations. This turns the LLM from an uncontrolled text generator into a typed function. Tradeoff: strict schemas can reduce the LLM's ability to express nuance or handle edge cases it wasn't designed for. The fix: design schemas with an 'other' or 'fallback' escape-hatch field, but make the common paths strictly typed. This pattern matters because it eliminates entire classes of parsing errors and makes agent chains composable—downstream agents can trust the shape of upstream outputs without defensive parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:16:26.949470+00:00— report_created — created