Unverified50% confidenceFactExact time
The main loop translates stop_reason into the next action decision: tool_use enters the tool execution branch, max_tokens triggers max_output_tokens_escalate or max_output_tokens_recovery, and prompt_too_long maps to reactive_compact_retry.
1
Sources
50%
Confidence
Long-term
Relevance
10/14/2026
First Seen
Sources
Related Entities
Related Claims
UnverifiedWhen using the legacy Agent, one should set max_iterations to prevent infinite loops, set timeouts, add early_stopping_method=generate, add input validation to tools, and integrate LangSmith for full-chain tracing.74% similarUnverifiedstop_reason is a field in the Anthropic Claude API response, with common values including end_turn, max_tokens, and tool_use.74% similarUnverifiedRecovery paths can stack in a chain: after a reactive compact succeeds it may hit max_tokens, the transition becomes max_output_tokens_escalate, and if reached again it becomes max_output_tokens_recovery.72% similarUnverifiedThe Max rework runs parameter controls the maximum number of rework attempts for a single task; once exceeded, the system marks the task as blocked for manual handling.70% similarUnverifiedThe #[MaxSteps(6)] attribute can be used to limit the maximum number of reasoning steps for an agent, preventing repeated tool calls from accumulating large amounts of tokens or falling into a loop69% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/1028897API
curl https://kongchang.com/api/v1/knowledge/claims/1028897MCP
get_claim(id=1028897)