R6 class representing a persistent, goal-oriented execution mission. A Mission is the global leadership layer above Agent/AgentTeam/Flow.
Key capabilities:
Full state machine: pending -> planning -> running -> succeeded/failed/stalled
LLM-driven auto-planning: converts a goal string into ordered MissionSteps
Step-level retry with exponential backoff + error-context injection
DAG dependency resolution (depends_on)
Parallel step execution (parallel = TRUE groups)
Checkpoint persistence: save() / resume()
Full audit log for post-mortem analysis
MissionHookHandler integration for observability
idUnique mission UUID.
goalNatural language goal description.
stepsList of MissionStep objects.
statusMission status string.
sessionSharedSession used across all steps.
modelDefault model ID for this mission.
stall_policyNamed list defining failure recovery behavior.
hooksMissionHookHandler for lifecycle events.
audit_logList of event records in chronological order.
auto_planIf TRUE and steps is NULL, use LLM to plan before running.
default_executorDefault executor for auto-planned steps.
new()Initialize a new Mission.
Mission$new(
goal,
steps = NULL,
model = NULL,
executor = NULL,
stall_policy = NULL,
hooks = NULL,
session = NULL,
auto_plan = TRUE
)goalNatural language goal description.
stepsOptional list of MissionStep objects. If NULL and
auto_plan=TRUE, the LLM plans them.
modelDefault model ID (e.g., "anthropic:claude-opus-4-6").
executorDefault executor for all steps (Agent, AgentTeam, Flow, or function). Used for auto-planned steps when no per-step executor is specified.
stall_policyNamed list with on_tool_failure, on_step_timeout, on_max_retries, escalate_fn. Defaults to default_stall_policy().
hooksMissionHookHandler for lifecycle events.
sessionOptional SharedSession. Created automatically if NULL.
auto_planIf TRUE, call LLM to decompose goal into steps when steps is NULL.
run()Run the Mission synchronously until completion or stall.
Mission$run(model = NULL, ...)modelOptional model override. Falls back to self$model.
...Additional arguments (reserved for future use).
Invisible self (inspect $status, $steps, $audit_log for results).
pathFile path (.rds).
resume()Resume a Mission from a saved checkpoint.
Mission$resume(path)pathFile path to a previously saved mission state (.rds).
Steps that are already "done" are skipped. Pending/failed/retrying steps are re-executed. The executor must be re-attached via $set_executor() or by providing a default_executor at Mission creation.
step_summary()Get a summary of step statuses.
Mission$step_summary()Named character vector: step_id -> status.
clone()The objects of this class are cloneable with this method.
Mission$clone(deep = FALSE)deepWhether to make a deep clone.