Kavi
Missions

Mission Lifecycle

Status progression from planning through completion, with checkpoint tracking.

Mission Lifecycle

Missions progress through a defined set of statuses as work moves from planning to completion. Kavi automatically synchronizes mission status based on task state and acceptance results, so the status always reflects the true state of the mission.

Mission Statuses

StatusDescription
planningInitial state when the mission is created with a planning task. Codex is decomposing the prompt into an execution plan.
activeTasks are executing. At least one task is pending or running.
blockedA task has failed or is blocked, or acceptance verification has failed. Requires operator attention.
awaiting_acceptanceAll tasks have completed successfully. The mission is waiting for acceptance verification to run.
ready_to_landAcceptance verification has passed. The mission can be landed into the target branch.
landedThe mission's work has been merged into the target branch.
completedTerminal state. The mission is fully done.

State Transitions

The following diagram shows how missions move between statuses:

planning
  |
  v
active <----------+
  |                |
  +---> blocked ---+
  |
  v
awaiting_acceptance
  |
  +---> blocked (acceptance failed) ---> active (retry)
  |
  v
ready_to_land
  |
  v
landed
  |
  v
completed

Transition Rules

  • planning to active: The planning task completes and produces an execution plan, or a direct root task begins executing.
  • active to blocked: Any task in the mission enters failed or blocked status.
  • blocked to active: The operator resolves the blocking issue (e.g., retries a failed task) and tasks resume.
  • active to awaiting_acceptance: All tasks in the mission reach completed status.
  • awaiting_acceptance to ready_to_land: All acceptance checks pass or are skipped.
  • awaiting_acceptance to blocked: An acceptance check fails. The operator must address the failure.
  • ready_to_land to landed: The operator runs kavi land, merging work into the target branch.
  • landed to completed: Terminal transition after landing.

Automatic Status Synchronization

Kavi runs syncMissionStates whenever session state changes. This function examines every mission and updates its status based on the current state of its tasks and acceptance pack:

  1. If the mission has been landed (landedAt is set), status is set to landed.
  2. If there are no execution tasks, the planning task is still active, and there is no direct root task, status remains planning.
  3. If any task is failed or blocked, status is set to blocked.
  4. If any task is pending or running, status is set to active (or planning if only the planning task is running and no plan has materialized yet).
  5. If all tasks are completed:
    • Acceptance failed: status is blocked
    • Acceptance passed: status is ready_to_land
    • Acceptance pending: status is awaiting_acceptance
  6. If a plan exists but no tasks remain, status is completed.

The active task list (activeTaskIds) is also refreshed during synchronization, filtering to only tasks with pending, running, or blocked status.

Checkpoints

Checkpoints are immutable progress markers recorded throughout the mission lifecycle. Each checkpoint captures a moment in the mission's execution history.

Checkpoint Kinds

KindTriggerDescription
createdMission creationRecorded when the mission is first created from the operator prompt.
planning_startedPlanning task dispatchedCodex has been assigned a planning task to decompose the prompt into an execution graph.
plan_materializedPlan attached to missionThe execution plan produced by the planning task has been attached to the mission.
task_startedTask begins executionAn agent has started working on a task belonging to this mission.
task_progressTask produces intermediate outputAn agent reports progress on a running task (e.g., files changed, intermediate results).
task_stalledTask stops making progressA running task has not produced output within the expected heartbeat interval.
task_completedTask finishes successfullyAn agent has completed a task with a successful result.
task_failedTask failsAn agent task has failed or been marked as blocked.
acceptance_verifiedVerification runsAcceptance checks have been executed and the pack status has been updated.
landedMission landsThe mission's work has been merged into the target branch via kavi land.

Checkpoint Fields

Each checkpoint records:

FieldTypeDescription
idstringUnique identifier (prefixed with checkpoint-)
kindstringOne of the checkpoint kinds listed above
titlestringShort human-readable title
detailstringExtended description of what happened
taskIdstring | nullID of the related task, if applicable
createdAtstringISO timestamp of when the checkpoint was recorded

Checkpoints are append-only. They provide a complete audit trail of the mission's execution history and are never modified or deleted after creation.

Example Checkpoint Sequence

A typical mission using guided_autopilot mode produces checkpoints in this order:

  1. created -- Mission created from operator prompt
  2. planning_started -- Codex begins planning
  3. plan_materialized -- Execution plan attached
  4. task_started -- First execution task begins
  5. task_progress -- Agent reports intermediate progress
  6. task_completed -- First task finishes
  7. task_started -- Second task begins (dependency satisfied)
  8. task_completed -- Second task finishes
  9. acceptance_verified -- Verification checks run
  10. landed -- Mission merged into target branch

On this page