Docs

Talk to Your Agents · 03.08

Chat Reliability: Watchdogs, Turn Deadlines & Budgeted Context

The idle watchdog, turn deadline, budgeted context window, and tool cap that keep a chat turn from running away.

ReliabilityLatency

Stopping by progress, not by a stopwatch

Chat used to stop a long-running agent turn on a wall-clock deadline and a small hard-coded turn count — which guillotined legitimate multi-step work while doing nothing to catch a model that was genuinely stuck looping. ChatProgressMonitor replaces the timer with real progress detection: the loop is allowed to keep running as long as it keeps producing something new, and stops the instant it detects a specific pathology.

DetectorCatches
identical_repetitionThe exact same tool + arguments issued repeatedly.
oscillationA short cycle of rounds repeating (A, B, A, B…).
error_stormEvery tool call failing across several consecutive rounds.
no_progressNo new action, new result, or new operator-visible text for a long streak — the complete backstop that always eventually fires for anything the other three miss.

"Progress" is defined strictly enough that a genuinely stuck agent can't manufacture novelty forever — but a long task that keeps taking distinct, productive steps never trips the monitor, no matter how long it legitimately takes.

The bounds that still apply underneath

Progress detection replaces the crude timer, but sane outer bounds still exist as a safety net: AGENTIS_CHAT_TURN_DEADLINE_MS and AGENTIS_CHAT_STREAM_TIMEOUT_MS bound total turn time and individual stream calls, and AGENTIS_CHAT_MAX_TOOL_CALLS (default 2000) bounds the round count — set high on purpose, because the progress monitor, not this number, is what actually stops a true infinite loop.

Continue