Skip to main content

run_autonomous_async

AsyncMethod
This is a method of the Agent class in the agent module.
Async variant of run_autonomous() for concurrent agent execution. This method executes a task autonomously using async I/O, enabling multiple agents to run concurrently without blocking. It handles:
  • Progressive escalation based on task complexity
  • Doom loop detection and recovery
  • Iteration limits and timeouts
  • Completion detection (keyword-based or promise-based)
  • Optional context clearing between iterations

Signature

Parameters

str
required
The task to execute
Optional[int]
Override max iterations (default from config)
Optional[float]
Timeout in seconds (default: no timeout)
Optional[str]
Optional string that signals completion when wrapped in <promise>TEXT</promise> tags in the response
bool
default:"False"
Whether to clear chat history between iterations (forces agent to rely on external state like files)

Returns

Any
AutonomyResult with success status, output, and metadata

Exceptions

If autonomy is not enabled

Usage

Uses

  • ValueError
  • time_module.time
  • isoformat
  • datetime.now
  • get_recommended_stage
  • AutonomyResult
  • is_set
  • achat
  • record_response
  • hash

Source

View on GitHub

praisonaiagents/agent/agent.py at line 4337

Async Feature

Background Tasks

Async Jobs