Record Action • AI Agent SDK

record_action: Record an action for loop detection.

record_action

Method

</div>

This is a method of the DoomLoopDetector class in the doom_loop module.

Record an action for loop detection.

Signature

python
def record_action(action_type: str, args: Dict[str, Any], result: Any, success: bool, duration: float, metadata: Optional[Dict[str, Any]]) -> Any

Parameters

ParamField str

Type of action (e.g., “read_file”, “edit”)

ParamField Dict[str, Any]

Action arguments

ParamField Any

Action result

ParamField bool

Whether action succeeded

ParamField float

Action duration in seconds

ParamField Optional

Optional metadata

Returns

ResponseField Any

The result of the operation.

Uses

  • ActionRecord
  • time.time
  • is_doom_loop

Used By

Source

View on GitHub

praisonaiagents/escalation/doom_loop.py at line 134