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 01 Queued request accepted entry 02 Planning build task graph model 03 Executing tool calls work 04 Reviewing quality gate check 05 Completed final response done Needs Approval human gate pause Blocked missing input wait Failed recoverable error retryable Cancelled user stopped 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