Autonomy & Missions
Relevant source files
The following files were used as context for generating this wiki page:
Autonomy & Missions defines a structured framework for managing bounded, agentic tasks within the Arena environment. It provides mechanisms for mission composition, persistence, execution, and scheduling, allowing agents to operate with high-level goals and constraints rather than just individual commands.
The system utilizes a mission lifecycle that includes drafting from templates, running autopilot loops, managing lineage between parent and child missions, and recovering from failures through iterations.
Mission Lifecycle and Architecture
The mission architecture centers on the transition from a natural language goal to a structured, executable plan. The lifecycle begins with Mission Composition, where a goal is mapped to a mission template and a set of planner steps.
Mission Lifecycle Flow
The following diagram illustrates the path from initial goal to execution and recovery.
The system organizes missions in a dedicated directory where each mission has its own folder containing a mission.json state file, a PLAN.md human-readable plan, and associated logs and artifacts.
Sources: arena/resources/missions_manage.py:79-99, arena/resources/mission_catalog.py:90-116
Mission Composition and Templates
The system uses templates to provide structure for common tasks. The function infer_mission_template matches keywords in goals or contexts to specific template IDs.
Key Mission Templates
| Template ID | Purpose | Keywords |
|---|---|---|
code-tdd | Test-driven development tasks | code, repo, test, bug, refactor |
browser-real-user | Browser-based workflows | site, page, form, web |
mcp-integration | MCP tool integrations | mcp, tool, integration |
lan-service | Local network operations | lan, port, service, scan |
cli-agent-core | Default fallback | - |
Sources: arena/resources/missions_manage.py:16-36
Drafting and Persistence
A mission draft is composed using compose_mission_draft, which combines a goal, context, constraints, and planner steps into a spec_version: 1 object. Persistence via create_mission_from_draft generates a unique mission ID based on the timestamp, a slug of the title, and a random suffix.
Sources: arena/resources/missions_manage.py:46-76, arena/resources/missions_manage.py:79-84
Mission Execution and Autopilot
Missions are executed via the mission_manager.py script. The execution can be fully autonomous (Autopilot) or managed step-by-step.
Autopilot Operations
The Mission Autopilot allows for bounded runs that execute explicit steps, persist progress, and generate flight records.
Execution Control Tools
The system provides several MCP tools for fine-grained control over execution:
- mission.run: Executes a persisted mission by ID.
- mission.rerun: Retries a mission, optionally only the last failed step.
- mission.autopilot_step: Appends or executes a single tool step inside an existing run.
- mission.autopilot_cancel: Interrupts a running or paused autopilot sequence.
Sources: arena/mcp/tool_registry_mission.py:36-41, arena/mcp/tool_mission.py:101-115
Mission Lineage and Families
The system tracks relationships between missions to maintain context across long-running or complex operations.
- Lineage: Tracks
parent_mission_id,root_mission_id, andancestor_ids. It calculateslineage_depthto show how far a mission is from its origin. - Origin: Defines how a mission was created (e.g.,
manual,linked, oriterate). - Family: Represents the full tree of missions rooted at a single origin, including all descendants and branch summaries.
Sources: arena/resources/mission_catalog.py:100-110, arena/resources/mission_catalog.py:133-145
Recovery and Iteration
When a mission fails, the system provides structured recovery paths.
- Recovery Bundle: Created via
mission.recover, it analyzes the state and suggests actions such as "rerun failed step" or "compose follow-up". - Iteration Loop: Combining recovery and follow-up creation,
mission.iterateallows an agent to reflect on failures, adjust the plan, and launch a new mission to address remaining goals.
Sources: arena/mcp/tool_registry_mission.py:42-45, tests/test_mission_management.py:151-177
Scheduling
Missions can be scheduled for recurring execution. The schedule system tracks "due" states and allows for automated iteration or reruns.
Schedule API Parameters
| Parameter | Type | Description |
|---|---|---|
schedule_id | string | Unique identifier for the schedule |
mission_id | string | The mission to be executed |
action | enum | run, rerun_failed, or iterate |
every_minutes | integer | Frequency of execution (default: 60) |
enabled | boolean | Whether the schedule is active |
Sources: arena/mcp/tool_registry_mission.py:48-52
Management Tools
- mission.schedules: Lists saved schedules and due-state summaries.
- mission.schedule_tick: Manually triggers due mission schedules.
- mission.schedule_delete: Removes a recurring schedule.
Sources: arena/mcp/tool_registry_mission.py:47-53
Summary
The Autonomy & Missions system enables structured agentic behavior by moving beyond isolated tool calls into persistent, goal-oriented "missions." By utilizing templates, tracking lineage, and providing robust recovery and scheduling tools, the framework allows agents to handle complex, multi-step tasks with built-in persistence and observability through the Local Bridge.
Sources: arena/resources/handlers.py:27-52, arena/mcp/tool_mission.py:7-27