OpenRouter publishes guide to stopping AI agent loops
Start here
OpenRouter published a guide on stopping AI agents that get stuck retrying a failing tool, built around four guards it says it tested on six current models. Three run inside the agent through the OpenRouter Agent SDK (@openrouter/agent 0.11.0): doom-loop detection, a rule for which calls count as repeats, and caps on steps and cost. The fourth is a credit limit on the API key, which returns a 402 with limit_source openrouter_key_limit. OpenRouter reports that with doomLoop detection enabled, all six models were blocked on their third identical tool call, and across 18 runs tool calls fell from 314 to 64 while spend dropped from $0.29 to $0.05. These are the company's own test results, not independently verified. Some conditions apply. Keys using BYOK must also set include_byok_in_limit to true, since it defaults to false and BYOK spend otherwise doesn't count toward the limit. Daily limits reset at midnight UTC and weekly limits on Monday.
Generated from reports · updated 13 h ago
Report timeline
Follow the reports to see the event from different sides.
- OpenRouter AnnouncementsOpenRouter 发布教程:如何阻止 AI Agent 陷入无限循环
OpenRouter published a guide on stopping AI agents that get stuck retrying a failing tool, using four guards tested on six current models. With doomLoop detection enabled, all six models were blocked on their third identical tool call, and across 18 runs tool calls fell from 314 to 64 while spend dropped from $0.29 to $0.05. The guide adds a loopKey to normalize arguments, stopWhen caps on steps and cost, and a credit limit on the API key that returns a 402 with limit_source openrouter_key_limit.
Heat for this event
Not enough continuous observations yet to draw a trend.