Every turn now logs WHY the agent loop ended to agent.log with a structured INFO line capturing: exit reason, model, api_calls/max, budget usage, tool turn count, last message role, response length, and session ID. When the last message is a tool result and the turn was NOT interrupted, emits WARNING level (visible in errors.log) — this is the 'just stops' scenario users report where a tool call completes but no continuation or final response follows. 10 tracked exit reasons: text_response, interrupted_by_user, interrupted_during_api_call, budget_exhausted, max_iterations_reached, all_retries_exhausted_no_response, fallback_prior_turn_content, empty_response_exhausted, error_near_max_iterations, unknown.
476 KiB
476 KiB