Skip to main content
  • task: The task you want to automate.
  • llm: Your favorite LLM. See Supported Models.
The agent is executed using the async run() method:
  • max_steps (default: 100): Maximum number of steps an agent can take.
Check out all customizable parameters here.

Run lifecycle

agent.status returns an AgentRunStatus snapshot. Use it instead of inferring state from logs or the final history:
  • phase: idle, starting, running, paused, stopping, succeeded, failed, max_steps, stopped, or cancelled
  • terminal: true only for succeeded, failed, max_steps, stopped, or cancelled
  • success, terminal_reason, result, error, step, max_steps, consecutive_failures, pause_requested, stop_requested, started_at, finished_at
A successful phase requires an accepted successful done action. A stop, pause, or caller cancellation is reported as its own phase and is not rewritten as success. A caller cancellation does not prove that the worker stopped; inspect status and run required cleanup before starting another task. pause() and resume() are cooperative. stop() is retained before run(), and the next run finishes as stopped before starting a browser. A stop after a terminal phase returns False. A second run() requires add_new_task().