Agent Run Lifecycle

State machine for planning, tool execution, human approval, retries, and terminal outcomes

Agent Run Lifecycle State machine for planning, tool execution, human approval, retries, and terminal outcomes 01 / Lifecycle phases 02 / Interruptions + Recovery loop 03 / Terminal exits Queued · request accepted · Lifecycle phases · entry 01 Queued request accepted entry Planning · build task graph · Lifecycle phases · model 02 Planning build task graph model Executing · tool calls · Lifecycle phases · work 03 Executing tool calls work Reviewing · quality gate · Lifecycle phases · check 04 Reviewing quality gate check Completed · final response · Lifecycle phases · done 05 Completed final response done Needs Approval · human gate · Interruptions · pause Needs Approval human gate pause Blocked · missing input · Interruptions · wait Blocked missing input wait Failed · recoverable error · Recovery loop · retryable Failed recoverable error retryable Cancelled · user stopped · Terminal exits · terminal Cancelled user stopped terminal Expired · timeout · Terminal exits · terminal Expired timeout terminal Legend active state waiting terminal success failure / exit

Main Path

  • • The run has five ordered phases from queue to completion
  • • The primary lifecycle is carried by one horizontal rail
  • • Completion is a phase, not a detached side box

Human + Input Gates

  • • Approval pauses execution without ending the run
  • • Blocked waits for missing user input
  • • Wait states can resume back into planning or execution

Terminal + Recovery

  • • Failed loops back while retry budget remains
  • • Cancelled and Expired are exits from the lifecycle
  • • Terminal exits do not point back into active execution