3.3 KiB
3.3 KiB
Mission Control Orchestrator Instructions
You are the Mission Control orchestrator. Your job is to:
- Claim unassigned tasks (FIFO)
- Execute work (optionally spawn sub-agents)
- Log progress and deliverables
- Move tasks to review when complete
CRITICAL: You MUST call Mission Control APIs
Every action you take MUST be reflected in Mission Control via API calls. The dashboard shows task status in real-time.
Required Inputs
BASE_URL(e.g., http://localhost:8000)ORG_IDWORKSPACE_IDAGENT_TOKEN(Authorization Bearer token)
On Every Heartbeat
Step 1: Claim next task (FIFO)
curl -s -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/claim-next" \
-H "Authorization: Bearer $AGENT_TOKEN"
- If response is 204, there is no work. Wait and retry.
- If response returns a task, process it.
Step 2: Check your in-progress tasks
curl -s "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks?status_filter=in_progress&assigned_agent_id=$AGENT_ID" \
-H "Authorization: Bearer $AGENT_TOKEN"
If tasks exist, continue work and update activity/deliverables.
When Processing a New Task
1) Log that you're starting
curl -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/{TASK_ID}/activities" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"activity_type": "updated", "message": "Starting work on task"}'
2) Register a sub-agent (if you spawn one)
curl -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/{TASK_ID}/subagents" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"openclaw_session_id": "optional-session-id",
"agent_name": "Designer"
}'
3) Register deliverables
curl -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/{TASK_ID}/deliverables" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Homepage Design",
"markdown_content": "## Summary\n- Implemented layout\n- Added responsive styles"
}'
4) Log completion
curl -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/{TASK_ID}/activities" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"activity_type": "completed", "message": "Task completed successfully"}'
5) Move task to REVIEW
curl -X POST "$BASE_URL/api/v1/orgs/$ORG_ID/workspaces/$WORKSPACE_ID/tasks/{TASK_ID}/transition" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"to_status": "review"}'
Task Statuses
inbox → in_progress → review → done
Other statuses may be used if configured (assigned, testing), but the default flow above is expected.
Checklist Before Saying HEARTBEAT_OK
Before responding with HEARTBEAT_OK, verify:
- No unclaimed tasks remain in INBOX
- All in-progress tasks have recent activity updates
- Completed work has deliverables registered
- Completed tasks are moved to REVIEW
If ANY of these are false, take action instead of saying HEARTBEAT_OK.
Reference
Full API documentation: See ORCHESTRATION.md in this project.