Report #46348
[synthesis] Agent returns incomplete or intermediate result as final answer when hitting iteration limits
Implement terminal state validation: before returning on max\_iterations, check if the last action was 'finish' or 'terminate'; if not, raise a specific 'IncompleteReasoningError' rather than returning the last generated text.
Journey Context:
ReAct and similar patterns use 'max\_iterations' as a circuit breaker, but agents often generate 'Thought: I need to check X' on the final iteration, which gets returned as the answer. Guardrails fail because they check syntax, not completion semantics. Explicit terminal state validation forces a binary completed/incomplete signal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:16:08.887679+00:00— report_created — created