# Missions (sending an agent)

<p class="generated-note">Generated from <a href="https://github.com/altasystem-ai/alta/blob/main/docs/standards/missions.md"><code>docs/standards/missions.md</code></a> · <code>npm run docs:gen</code></p>

Code: [`core/missions/missions.ts`](https://docs.altasystem.ai/reference/advanced/core-api/missions-missions). Tests: [`tests/contracts.test.ts`](https://github.com/altasystem-ai/alta/blob/main/tests/contracts.test.ts). Lot M builds the route
([`server/routes/missions.mjs`](https://github.com/altasystem-ai/alta/blob/main/server/routes/missions.mjs), capability `ask`, already in the route table) and the feature.

Status: **alpha**. This format can still change before its 1.0; a change follows the versioning rules of the project and is announced in the changelog.

- Agents: `daemon` (sent as `main`: `agentArg`), `architect`, `operator`, `reviewer`, `guardian`.
- `MissionRequest { agent, text, quest?, step?, target? (entity id) }`;
  `checkMissionRequest(r)` refuses an unknown agent, an empty text, a text over `MAX_TEXT` (4000).
- `Mission { id, agent, state: "out"|"ok"|"failed", quest?, step?, key? (the step key it proves), target?, sentAt, backAt?, durationMs?, reply?, error?, archived? }`; a reply is
  cut at `MAX_REPLY` (8000); a mission still out after `MISSION_TIMEOUT_MS` (10 min) fails.
- `estimate(past, agent)`: median duration of that agent's last missions, or null.
- `missionsByKey(list)` gives `Context.missions` for the `mission` check of [alta-game-0.2](alta-game-0.2).
- Sending goes through the `agent.message` executor: the text is passed on **stdin** only
  (`openclaw agent --agent <a> --message-file - --json`), never in argv, never in a journal.
