When a subagent hit max_iterations, status was always 'failed' even if it produced a usable summary via _handle_max_iterations(). This happened because the status check required both completed=True AND a summary, but completed is False whenever max_iterations is reached (run_agent.py line 7969). Now gates status on whether a summary was produced — if the subagent returned a final_response, the parent has usable output regardless of iteration budget. The exit_reason field already distinguishes 'completed' vs 'max_iterations' for anything that needs to know how the task ended. Closes #1899.
32 KiB
32 KiB