AltimateAI / AltimateAI/altimate-code

Doom loop circuit breaker allows infinite loops in headless mode

Open
#657 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
811
Forks
134
Avg merge
3d 2h
Merged PRs (30d)
50

Description

## Problem

When `doom_loop` permission is auto-accepted (headless mode or `doom_loop: "allow"` in config), the per-tool repeat counter resets to 0 every 30 calls and loops run indefinitely. Observed in production telemetry: a single session made 10,943 `apply_patch` calls and 1,791 `todowrite` calls in 4 hours, consuming ~98.8M input tokens.

## Root Cause

The existing doom loop detection asks permission every 30 calls of the same tool, then resets the counter. In headless/automated environments where permission is auto-accepted, the counter resets and the loop continues with no upper bound.

## Expected Behavior

Sessions should escalate and eventually force-stop when the same tool is called excessively, regardless of permission configuration.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.