moa_tower_spawn
Spawns a tower agent (worker or reviewer) by creating a dedicated git worktree, registering it as the mission owner, and launching the agent in the foreground to execute the mission or review a branch.
Instructions
Two-stage spawn (tower-only, B1 bookkeeping stage): creates the mission's physical git worktree (sibling -worktrees/wt-, never inside the repo), marks the mission active with the agent as owner, and registers the roster entry with a PENDING agent id. The tower then launches the agent with its own Agent tool in the FOREGROUND (never run_in_background=true — a backgrounded child cannot wake the tower when it completes): phase 1 does offline work only (workers: code + local commits; reviewers: read-only verdict draft) with no tower calls, then moa_tower_register(agent_id=…) completes the enrollment and a foreground resume (phase 2) lets the agent submit tower reports under its own identity. Argument combos: worker spawn = {name, kind:"worker", mission_id}; reviewer spawn = {name, kind:"reviewer", review_target} — the matching mission_id / review_target argument is REQUIRED for the chosen kind. Reviewers take review_target (a branch to review) instead of a mission.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | workers execute a mission in their worktree; reviewers review one branch | |
| name | Yes | Unique tower name (e.g. "agent-build", "reviewer-a"); used for inbox addressing and mission ownership | |
| workspace | Yes | The absolute repo root (main checkout) this tower namespace anchors to. Required on every tower tool — the server cwd is never used as a fallback. | |
| mission_id | No | Required for workers: the mission id (e.g. "M1") from moa_tower_plan | |
| instructions | No | Extra tower instructions for the agent briefing | |
| review_target | No | Required for reviewers: the branch to review (e.g. "feat/M2-x") | |
| caller_agent_id | Yes | Your engine agent id. The tower tools resolve it against the boot-registered roster (the booted tower, or a spawned worker/reviewer). |