Report #100338
[synthesis] Agent loop returns stop\_reason='end\_turn' and looks successful, but the answer is wrong or incomplete
Never treat loop termination as proof of correctness. Add a separate verification step that checks the final output against the original goal and required invariants before returning to the user.
Journey Context:
The model stops when it believes it is done, not when the task is actually satisfied. Anthropic's loop semantics make this explicit: 'end\_turn' only means the model finished its turn naturally; the Agent SDK adds max\_turns/max\_budget\_usd as guardrails, not validators. Developers commonly branch on stop\_reason and return content verbatim, which silently ships wrong answers. The fix is to separate termination control from solution verification, using a deterministic checker, a second model-as-judge, or a hand-authored assertion set. This is the single biggest gap between demo agent code and production agent code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T05:03:20.700335+00:00— report_created — created