Unverified50% confidenceSolutionExact time
驱动Agent Loop循环的两个信号来自模型返回的stop_reason字段:当stop_reason等于tool_use时宿主执行工具并继续循环,否则循环退出
1
Sources
50%
Confidence
Long-term
Relevance
8/24/2026
First Seen
Sources
Related Entities
Related Claims
Unverified在Agent Loop中如果只将工具结果塞回messages而漏掉assistant消息,模型会陷入无限循环,不断重复调用工具76% similarUnverified语义循环从代码执行流程看Agent在正常工作,每次调用的参数和上下文略有不同,不会触发传统死循环检测机制66% similarUnverifiedstop_reason is a field in the Anthropic Claude API response, with common values including end_turn, max_tokens, and tool_use.66% similarUnverifiedWhen 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.65% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/795671API
curl https://kongchang.com/api/v1/knowledge/claims/795671MCP
get_claim(id=795671)