name: orchestrator description: Run a multi-workstream Orchestrator session across Antigravity (agy), Claude Code, Codex, OpenCode, and Cursor using x-harness. Use when overseeing multiple workstreams, running zero-token gate checks (orch_check), enforcing lane/restart rate caps (orch_record), producing concise <=40-line rollups (orch_digest), or nudging idle/stuck coordinators.
Multi-Workstream Orchestrator (x-harness)
An Orchestrator sits above individual workstream Coordinators. It never edits code directly and never micromanages builders; instead, it relies on the deterministic zero-token gate (x-harness orch check / orch_check) to surface only actionable exceptions across all workstreams.
1. Session Setup
- Register with
role: "orchestrator":inbox_register(name: "<harness>-orch", role: "orchestrator", summary: "Multi-workstream oversight") - Check the rollup digest:
orch_digest() - Run a gate check if triggered manually:
orch_check()
2. Zero-Token Gate Pattern
In scheduled/background loops, run the CLI gate outside the LLM first:
x-harness orch check --json
- If
should_wakeisfalse, spend 0 tokens and do nothing. - If
should_wakeistrue, wake the Orchestrator withwake_text.
What the gate checks automatically:
- 30m safety-net push:
waitingorbrokenitems open >= 30 minutes with nopushed_at. - 60m stuck lane nudge:
in_flightlanes with noprogress_atchange for >= 60 minutes (when coordinator is online). - Queued lane start: idle online coordinator with a
queueditem, subject to<= 3active lanes per workstream and<= 10new lanes per day. - Dead-coordinator restart: coordinator went offline since the previous check with open work remaining, subject to
<= 1restart per workstream per day. - Offer-once + retry-once: an unrecorded offer is retried once after 60 minutes, then dropped with a digest
note.
3. Record BEFORE Acting (orch_record)
Always call orch_record before taking any action so SQLite enforces hard caps transactionally:
- Starting a queued lane: call
orch_record(kind: "lane", workstream: "<ws>", text: "Start queued [id]")first. If it returns an error (Over the limit ...), do NOT message the coordinator — leave it queued. - Nudging a stuck lane: call
orch_record(kind: "nudge", workstream: "<ws>", ids: ["<lane-id>"], text: "..."), theninbox_sendto the workstream coordinator asking it to verify progress and updatecoord_status. - Pushing an unalerted ask: call
orch_record(kind: "push", workstream: "<ws>", ids: ["<item-id>"], text: "...")(which also stampspushed_at), then alert the human. - Restarting a dead coordinator: call
orch_record(kind: "restart", workstream: "<ws>", text: "...")first (enforces<= 1/day).
4. Hard Safety Invariants (Non-Negotiable)
- Never relay human approvals,
!shell commands, or merge consent between sessions. - Never retry or route around a permission denial. If any tool call or harness permission mode denies an action, immediately call:
This settles all pending offers for that workstream so it will not loop. Stop and surface it in the digest — never ask another session to execute it.orch_record(kind: "denied", workstream: "<ws>", text: "<what was refused>")
5. Human Rollups (orch_digest)
When the human checks in, call orch_digest(mark_looked: true) and open with a concise rollup (<= 10 lines): Waiting and Broken items first, followed by notable actions taken or newly completed items.