Skip to Content
Rius

How do I get alerted when my agent keeps calling the same tool?

Rius ships a pre-defined Tool Loop alert that fires when an agent calls the same tool with identical parameters at least three times in a row inside one trace. Enable it on the Alerts page, attach a channel, and each firing links to the trace where the loop happened. You do not write a rule: you only tune its thresholds. See Alerts for how firings work in general.

How it works

Tool Loop is one of the curated detectors described in Pre-defined alerts. It looks inside a single trace and counts calls that match on the tool name and normalized arguments.

  • What counts as a loop: the identical calls must form a run. Taken in start order, at most one other tool call sits between neighboring repeats. A tool the agent returns to after doing other work is routine and does not fire.
  • Knobs: identical calls (default at least 3, and 3 is also the minimum), time window (default 10 minutes), and Renotify (default off).
  • One firing per trace and tool. A second looping tool in the same trace is a separate firing.
  • Arguments must be captured. Calls whose arguments were not captured, for example with content capture off, are never counted as identical. If you set RIUS_CAPTURE_CONTENT to false, Tool Loop has nothing to compare.
  • Cadence: rules are evaluated every minute while they have no open firing and every five minutes while one is open, so timing is approximate to that.

The problems it is built to catch are an agent repeating the same search because no result meets its stop condition, a broken tool schema where the model retries the identical call, and a planner and executor cycling on the same lookup.

Set it up

  1. Open the Alerts page and find Tool Loop under Pre-defined alerts. Open its details page. Enabling, disabling and tuning alerts are admin actions.
  2. Enable the alert. It is a pre-defined alert, so you can disable it but not delete it.
  3. Set the knobs. Raise Identical calls if short, legitimate repeats are normal for your agent. Widen or shorten the Time window to change how far back calls inside the trace are counted.
  4. Attach a distribution channel (webhook, email or Slack) so every firing is delivered.
  5. Choose a Renotify policy. Off sends one notification per firing. Every N minutes, from 5 to 1440, repeats it until someone acknowledges the firing or it resolves.
  6. Make sure your agent sends tool arguments, because calls without captured arguments never count as identical.

Tool Loop cannot be narrowed to one service the way Consistent Error Pattern and Swallowed Error can. It watches the whole workspace.

If you also want a threshold on a workspace metric, such as cost per trace, a custom alert uses this shape:

FILTERS Service = checkout-agent (optional, applied before aggregation) RULES avg(Cost) > $0.50 AND count(Errors) > 10 WINDOW 15 minutes (shared by all rules)

What you get

  • A notification on each channel attached to the alert, with a delivery list showing one row per channel and the outcome of each attempt.
  • A count in the sidebar. The Alerts entry shows open firings nobody has acknowledged yet.
  • A firing page. Open the firing from the alert’s details page, the Recent firings section or the Firings page. It shows when the firing opened, when the condition was last seen, and the affected traces, each linked to the trace view. View all in Traces opens the trace list filtered to the firing’s signature and time window. Open the trace to see the repeated tool calls in order.
  • Acknowledgment. Ack records who saw the firing and stops further notifications for it. It does not close the firing.
  • Automatic resolution. After the condition has stopped matching for two hours, the firing resolves. If the same loop returns later, that is a new, unacknowledged firing.
  • Optional root-cause analysis. When the alert’s Root-cause analysis switch and the workspace setting are both on, the firing page carries a report on what failed and its reading of the cause.

Saving a change to the alert resolves its open firings and starts evaluating afresh, so a loop that is still happening opens a new firing under the new settings.

When something else fits

Use a custom alert when you want a threshold on a metric such as cost, tokens, duration or LLM calls, optionally scoped to a service or model. Use Consistent Error Pattern when the problem is the same error recurring across runs rather than the same successful call repeating. Tool Loop looks inside one trace only, so a pattern spread across many traces needs one of those instead.

Still stuck? Get help

Last updated on