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
Optional[DoomLoopConfig]
No description available.
Methods
start_session()
Start a new detection session.
record_action()
Record an action for loop detection.
record_response()
Record model response text for content streaming loop detection.
mark_progress()
Mark meaningful progress.
is_doom_loop()
Check if current state indicates a doom loop.
get_loop_type()
Get the type of doom loop detected.
get_loop_event()
Get the current loop event if one exists.
get_recovery_action()
Get recommended recovery action.
apply_backoff()
Apply backoff delay and return the delay used.
reset_backoff()
Reset backoff to initial value.
increment_recovery()
Increment recovery attempt counter.
get_stats()
Get detection statistics.
Usage
Source
View on GitHub
praisonaiagents/escalation/doom_loop.py at line 90
