Docs

Talk to Your Agents · 07.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.

Stop means stop the work, not just the browser stream

The red Stop control performs a conversation-scoped hard stop. It aborts the server-side model turn, discards queued composer follow-ups, and cancels CREATED, PLANNING, RUNNING, WAITING, or PAUSED workflow runs created by that conversation. Scheduled and unrelated App automation are deliberately outside that scope. Closing an SSE connection alone is not treated as cancellation, and a hard-stopped turn cannot auto-dispatch the next queued message behind the operator's back.

Chat and self-heal cannot spend the same agent twice

An agent-scoped interactive lease serializes expensive interactive loops. Operator chat has higher priority than background self-heal and can preempt it; two equal-priority turns serialize instead of racing. The cancellation signal propagates through the repair planner, tool loop, and structured completion fallbacks, so a preempted repair does not reappear as a blocker or start another paid retry.

Continue