task: The task you want to automate.llm: Your favorite LLM. See Supported Models.
run() method:
max_steps(default:100): Maximum number of steps an agent can take.
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, orcancelledterminal:trueonly forsucceeded,failed,max_steps,stopped, orcancelledsuccess,terminal_reason,result,error,step,max_steps,consecutive_failures,pause_requested,stop_requested,started_at,finished_at
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().