Doom Loop Detector • AI Agent SDK

DoomLoopDetector: Detects and prevents doom loops in agent execution.

DoomLoopDetector

Defined in the Doom Loop module.

AI Agent

Detects and prevents doom loops in agent execution.

Monitors action history for patterns that indicate stuck states:

  • Repeated identical actions
  • Repeated similar actions
  • Consecutive failures
  • No meaningful progress

Constructor

ParamField Optional[DoomLoopConfig]

No description available.

Methods

Usage

python
detector = DoomLoopDetector()

    # Record actions
    detector.record_action("read_file", {"path": "foo.py"}, "content", True)
    detector.record_action("read_file", {"path": "foo.py"}, "content", True)

    # Check for loops
    if detector.is_doom_loop():
        event = detector.get_loop_event()
        recovery = detector.get_recovery_action()

Source

View on GitHub

praisonaiagents/escalation/doom_loop.py at line 90