diff --git a/.claude/orchestrator.json b/.claude/orchestrator.json
index 7ca37e533e..9fb1c7e7a7 100644
--- a/.claude/orchestrator.json
+++ b/.claude/orchestrator.json
@@ -3,15 +3,34 @@
"workers": {
"claude": {
"command": "claude",
- "args": ["--permission-mode", "bypassPermissions", "--model", "opus"],
+ "args": ["--permission-mode", "bypassPermissions"],
+ "models": {
+ "default": { "model": "opus" },
+ "cheap": { "model": "sonnet" },
+ "deep": { "model": "opus", "args": ["--effort", "max"] }
+ },
"interactive": true,
- "notes": "The prompt is the ticket body (D2). Model routing: opus for cross-repo, parity-bound, contract-touching or hard tickets; sonnet for proven-isolated slices; flip per ticket via the ticket's worker:sonnet label. The mode MUST be bypassPermissions, never acceptEdits: acceptEdits auto-approves file writes only, so every shell command still prompts, and a worker with nobody at the keyboard is stuck. Measured on the ORB-75 Phase 7 run, where git switch, dotnet build/test/format, gh and orca were all denied and the worker delivered files with zero gates run, zero commit and zero PR. There is deliberately no -p here either: headless mode is invisible to Orca, so the worktree card shows no Agents row and clicking it reveals a bare shell. The worker runs as a TUI, which means orca terminal wait must use --for tui-idle, never --for exit. One more thing a TUI worker needs answered for it: a brand-new worktree is a folder Claude Code has never seen, so its first screen is the workspace-trust gate (Quick safety check: Is this a project you created or one you trust? with 1. Yes, I trust this folder). Measured on the 2026-07-24 ORB-75 launch, where orca terminal wait --for tui-idle returned satisfied: false with blockedReason codex-trust-workspace and the worker sat on that screen with nobody at the keyboard. Same failure class as the permission mode above: the fix is to send 1 and Enter and wait again, which tools/launch-worker.mjs now does on every launch. Two more things measured on that same run, both about talking to a live worker. First, never orca terminal send to a worker that is not tui-idle: a send issued mid-turn is not delivered as a user turn at all. In the worker's own session transcript it appears only as four type: queue-operation records, never as a type: user entry, and the running turn was cut short on the mid-flow sentence Now the auth-side signup tests., leaving 14 modified and 7 untracked files with zero commits, zero gates and no PR. Everything a worker needs belongs in the prompt FILE at launch; mid-run information is appended to that file and pointed at, which is what tools/nudge-worker.mjs enforces by refusing to send while the terminal is busy. Second, tui-idle means stopped, not done: the same run read satisfied: true as completion when the worker had abandoned the task with nothing committed. Idle is a trigger to run tools/worker-status.mjs, which derives the verdict from commits, push, PR and Linear state, never a report of success."
+ "notes": "The prompt is the ticket body (D2). Model routing: the default is opus, tier:cheap selects sonnet, and tier:deep selects opus with --effort max so hard work gets a distinct invocation without changing the no-label default. The legacy worker:sonnet label is rejected loudly with remediation to use tier:cheap. The mode MUST be bypassPermissions, never acceptEdits: acceptEdits auto-approves file writes only, so every shell command still prompts, and a worker with nobody at the keyboard is stuck. Measured on the ORB-75 Phase 7 run, where git switch, dotnet build/test/format, gh and orca were all denied and the worker delivered files with zero gates run, zero commit and zero PR. There is deliberately no -p here either: headless mode is invisible to Orca, so the worktree card shows no Agents row and clicking it reveals a bare shell. The worker runs as a TUI, which means orca terminal wait must use --for tui-idle, never --for exit. One more thing a TUI worker needs answered for it: a brand-new worktree is a folder Claude Code has never seen, so its first screen is the workspace-trust gate (Quick safety check: Is this a project you created or one you trust? with 1. Yes, I trust this folder). Measured on the 2026-07-24 ORB-75 launch, where orca terminal wait --for tui-idle returned satisfied: false with blockedReason codex-trust-workspace and the worker sat on that screen with nobody at the keyboard. Same failure class as the permission mode above: the fix is to send 1 and Enter and wait again, which tools/launch-worker.mjs now does on every launch. Two more things measured on that same run, both about talking to a live worker. First, never orca terminal send to a worker that is not tui-idle: a send issued mid-turn is not delivered as a user turn at all. In the worker's own session transcript it appears only as four type: queue-operation records, never as a type: user entry, and the running turn was cut short on the mid-flow sentence Now the auth-side signup tests., leaving 14 modified and 7 untracked files with zero commits, zero gates and no PR. Everything a worker needs belongs in the prompt FILE at launch; mid-run information is appended to that file and pointed at, which is what tools/nudge-worker.mjs enforces by refusing to send while the terminal is busy. Second, tui-idle means stopped, not done: the same run read satisfied: true as completion when the worker had abandoned the task with nothing committed. Idle is a trigger to run tools/worker-status.mjs, which derives the verdict from commits, push, PR and Linear state, never a report of success."
},
"codex": {
"command": "codex",
- "args": ["-c", "windows.sandbox=\"unelevated\"", "-c", "model_reasoning_effort=\"high\"", "-m", "gpt-5.6-sol", "--dangerously-bypass-approvals-and-sandbox"],
+ "args": ["-c", "windows.sandbox=\"unelevated\"", "--dangerously-bypass-approvals-and-sandbox"],
+ "models": {
+ "default": {
+ "model": "gpt-5.6-sol",
+ "args": ["-c", "model_reasoning_effort=\"high\""]
+ },
+ "cheap": {
+ "model": "gpt-5.6-luna",
+ "args": ["-c", "model_reasoning_effort=\"low\""]
+ },
+ "deep": {
+ "model": "gpt-5.6-sol",
+ "args": ["-c", "model_reasoning_effort=\"max\""]
+ }
+ },
"interactive": true,
- "notes": "Requires a paid ChatGPT plan plus codex login; a headless session can start that itself with codex login --device-auth, which prints a URL and a one-time code for the account owner to enter. CODEX_HOME DECIDES WHETHER A WORKER IS LOGGED IN, and it is the first thing to check before believing any auth verdict: Orca redirects codex's home for the terminals it spawns, so on this machine the real credential is C:\\Users\\thoma\\AppData\\Roaming\\orca\\codex-runtime-home\\home\\auth.json, not the default ~/.codex/auth.json. Measured 2026-07-27: a shell that had lost CODEX_HOME reported 'Not logged in' and codex doctor reported 'no Codex credentials were found', while the very same CLI in an Orca terminal in the same worktree reported 'Logged in using ChatGPT' minutes earlier. For an unattended worker those two states are indistinguishable from having no plan at all, and the worker dies on a login screen nobody is there to answer. Two consequences. Never diagnose codex auth from an ad hoc shell without printing CODEX_HOME first. And a codex worker that never reaches tui-idle should be suspected of sitting on the login splash: that splash ANIMATES, so the repaint check in tools/launch-worker.mjs now turns it into a loud exit 1 rather than a prompt pointer typed into a sign-in screen. Reads AGENTS.md natively. The invocation is bare codex with no subcommand, which is what codex --help means by 'If no subcommand is specified, options will be forwarded to the interactive CLI'. codex exec is the NON-interactive subcommand and lands in the same unsupervisable place as claude -p, so tools/launch-worker.mjs still refuses it (per-engine headless tokens: exec and its alias e for codex, -p and --print for claude, because codex's -p is --profile, a legitimate interactive flag). Approval and sandbox policy is --dangerously-bypass-approvals-and-sandbox, not the equivalent pair -a never --sandbox danger-full-access, and never --full-auto: --full-auto is -a on-request --sandbox workspace-write, and on-request lets the MODEL decide when to ask a human who is not at the keyboard. The single flag beats the pair because the pair has a half-state: an edit that drops -a never while keeping the sandbox flag silently restores approval prompts to a worker nobody is watching, which is the exact failure this entry exists to prevent. The containment story is the disposable Orca worktree, the same one that justifies claude's bypassPermissions. Everything below was measured on 2026-07-27 against codex-cli 0.145.0 on Windows 11. -c windows.sandbox=\"unelevated\" is load-bearing: Codex's default Windows sandbox is elevated, its setup needs Administrator rights, and the first-run TUI paints 'Set up default sandbox (requires Administrator permissions)' then sits on 'Setting up sandbox... Input disabled until setup completes' forever in a PTY that has no desktop to raise UAC on. Measured still spinning after 2.5 minutes, with orca terminal wait reporting satisfied: true throughout, a false idle. The unelevated fallback (restricted tokens and ACLs, learn.chatgpt.com/docs/windows/windows-sandbox) needs no elevation, and the worker never executes inside it anyway because the bypass flag runs commands unsandboxed. cwd needs no -C: orca terminal create --worktree already starts the TUI in the worktree. Supervision, all measured: a real TUI opens, so the Orca card carries an Agents row and orca terminal wait --for tui-idle has a state to observe. The first screen in a brand-new worktree is codex's own trust gate, 'Do you trust the contents of this directory?', which normally reports blockedReason codex-interactive-prompt. Orca 1.4.156 was also measured retaining codex-trust-workspace on an idle codex terminal that never saw a trust gate. WHY: PR #629 owner adjudication makes that live capture authoritative over the older one-reason-per-engine mapping. It is a preselected list whose own instruction reads 'Press enter to continue', so the answer is Enter ALONE; the 1 then Enter that answers Claude Code's gate left the codex process exited (-1). launch-worker.mjs therefore keeps the trust answer per engine. Never blind-Enter an unrecognised codex screen: a stray Enter meant for one prompt was measured confirming the NEXT one, which is how the Administrator sandbox setup above got selected. Everything the claude entry says about talking to a live worker holds here unchanged: never send to a terminal that is not tui-idle, and tui-idle means stopped, not done, so it is the trigger to run tools/worker-status.mjs, never a report of success."
+ "notes": "Model routing: the default is gpt-5.6-sol at high reasoning, tier:cheap selects gpt-5.6-luna at low reasoning, and tier:deep selects gpt-5.6-sol at max reasoning. Sol-high is the default because Terra-medium lost two review rounds on ORB-124 / PR #619 due care failures; xhigh and max were held in reserve for this per-ticket routing. The legacy worker:sonnet label is rejected loudly with remediation to use tier:cheap. Requires a paid ChatGPT plan plus codex login; a headless session can start that itself with codex login --device-auth, which prints a URL and a one-time code for the account owner to enter. CODEX_HOME DECIDES WHETHER A WORKER IS LOGGED IN, and it is the first thing to check before believing any auth verdict: Orca redirects codex's home for the terminals it spawns, so on this machine the real credential is C:\\Users\\thoma\\AppData\\Roaming\\orca\\codex-runtime-home\\home\\auth.json, not the default ~/.codex/auth.json. Measured 2026-07-27: a shell that had lost CODEX_HOME reported 'Not logged in' and codex doctor reported 'no Codex credentials were found', while the very same CLI in an Orca terminal in the same worktree reported 'Logged in using ChatGPT' minutes earlier. For an unattended worker those two states are indistinguishable from having no plan at all, and the worker dies on a login screen nobody is there to answer. Two consequences. Never diagnose codex auth from an ad hoc shell without printing CODEX_HOME first. And a codex worker that never reaches tui-idle should be suspected of sitting on the login splash: that splash ANIMATES, so the repaint check in tools/launch-worker.mjs now turns it into a loud exit 1 rather than a prompt pointer typed into a sign-in screen. Reads AGENTS.md natively. The invocation is bare codex with no subcommand, which is what codex --help means by 'If no subcommand is specified, options will be forwarded to the interactive CLI'. codex exec is the NON-interactive subcommand and lands in the same unsupervisable place as claude -p, so tools/launch-worker.mjs still refuses it (per-engine headless tokens: exec and its alias e for codex, -p and --print for claude, because codex's -p is --profile, a legitimate interactive flag). Approval and sandbox policy is --dangerously-bypass-approvals-and-sandbox, not the equivalent pair -a never --sandbox danger-full-access, and never --full-auto: --full-auto is -a on-request --sandbox workspace-write, and on-request lets the MODEL decide when to ask a human who is not at the keyboard. The single flag beats the pair because the pair has a half-state: an edit that drops -a never while keeping the sandbox flag silently restores approval prompts to a worker nobody is watching, which is the exact failure this entry exists to prevent. The containment story is the disposable Orca worktree, the same one that justifies claude's bypassPermissions. Everything below was measured on 2026-07-27 against codex-cli 0.145.0 on Windows 11. -c windows.sandbox=\"unelevated\" is load-bearing: Codex's default Windows sandbox is elevated, its setup needs Administrator rights, and the first-run TUI paints 'Set up default sandbox (requires Administrator permissions)' then sits on 'Setting up sandbox... Input disabled until setup completes' forever in a PTY that has no desktop to raise UAC on. Measured still spinning after 2.5 minutes, with orca terminal wait reporting satisfied: true throughout, a false idle. The unelevated fallback (restricted tokens and ACLs, learn.chatgpt.com/docs/windows/windows-sandbox) needs no elevation, and the worker never executes inside it anyway because the bypass flag runs commands unsandboxed. cwd needs no -C: orca terminal create --worktree already starts the TUI in the worktree. Supervision, all measured: a real TUI opens, so the Orca card carries an Agents row and orca terminal wait --for tui-idle has a state to observe. The first screen in a brand-new worktree is codex's own trust gate, 'Do you trust the contents of this directory?', which normally reports blockedReason codex-interactive-prompt. Orca 1.4.156 was also measured retaining codex-trust-workspace on an idle codex terminal that never saw a trust gate. WHY: PR #629 owner adjudication makes that live capture authoritative over the older one-reason-per-engine mapping. It is a preselected list whose own instruction reads 'Press enter to continue', so the answer is Enter ALONE; the 1 then Enter that answers Claude Code's gate left the codex process exited (-1). launch-worker.mjs therefore keeps the trust answer per engine. Never blind-Enter an unrecognised codex screen: a stray Enter meant for one prompt was measured confirming the NEXT one, which is how the Administrator sandbox setup above got selected. Everything the claude entry says about talking to a live worker holds here unchanged: never send to a terminal that is not tui-idle, and tui-idle means stopped, not done, so it is the trigger to run tools/worker-status.mjs, never a report of success."
}
},
"maxParallelWorktrees": 8,
diff --git a/.claude/skills/orchestrate/SKILL.md b/.claude/skills/orchestrate/SKILL.md
index 6cec9bb5b0..cc536a9d19 100644
--- a/.claude/skills/orchestrate/SKILL.md
+++ b/.claude/skills/orchestrate/SKILL.md
@@ -186,9 +186,12 @@ fatal to an unattended worker:
TUI is never sent to twice: it settles and re-reads instead, because a second send into a busy
worker is the ORB-75 corruption.
-It also applies the model routing orchestrator.json's notes name: a ticket labelled
-`worker:sonnet` swaps `--model opus` for `--model sonnet`; every other ticket uses the
-configured args verbatim.
+It also resolves model routing from the selected engine's `models` map in
+orchestrator.json. No tier label selects `default`; `tier:cheap` and `tier:deep` select
+the corresponding engine-specific entries. A tier must change the resolved invocation.
+Unknown or conflicting tier labels, missing mappings, and identical tier invocations
+fail the launch loudly. The legacy `worker:sonnet` label is rejected with remediation to
+use `tier:cheap`; it is never silently translated or ignored.
**Why not `claude -p`.** Headless mode is invisible to Orca: it is not a TUI, so the
worktree card shows no Agents row and clicking the card reveals only a bare shell.
@@ -227,8 +230,12 @@ sandbox... Input disabled until setup completes" forever in a PTY with no deskto
UAC on, while `orca terminal wait` reports `satisfied: true` throughout. The prerequisite
the harness cannot supply is the account: a paid ChatGPT plan and `codex login`
(`codex login --device-auth` works from a headless session, printing a URL and a one-time
-code). Making codex the DEFAULT is still a separate decision (D5) and Thomas's call; this
-only makes selecting it work.
+code). Its model map defaults to gpt-5.6-sol at high reasoning, maps `tier:cheap` to
+gpt-5.6-luna at low reasoning, and maps `tier:deep` to gpt-5.6-sol at max reasoning.
+Sol-high is the routine default because Terra-medium lost two review rounds on ORB-124 /
+PR #619 to care failures. The ADR reserves xhigh and max for per-ticket routing, so
+`tier:deep` spends max while the no-label invocation remains high. Model routing does not
+change the top-level `worker` selection; D5 keeps that as an explicit configuration decision.
Two consequences of dropping `-p`. The process does NOT exit when the work is done, so
wait with `--for tui-idle`, never `--for exit`. And the permission mode must still come
diff --git a/CLAUDE.md b/CLAUDE.md
index 769fda5131..e973654dd6 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -12,7 +12,7 @@ While building or fixing, see something broken, stale, or wrong? Fix it immediat
## The workflow (D1-D9)
-Linear is the source of truth for product work in this repo and orbit-api; GitHub Issues holds orbit-landing-page, infra chores, and Dependabot (D1). The ticket is the prompt (D2); one ticket = one repo = one reviewable PR, target under 400 lines (D4), and cross-repo work uses an API ticket blocking a UI ticket. The worker engine lives in `.claude/orchestrator.json` (D5); a `visible-effect` ticket needs final screenshots, a critique artifact, and test output before In Review (D7). `RENDER-CORRECTNESS.md` defines the bounded self-critique after capture. Invoke `tools/` scripts through their skills or agents; after `/next`, run `/orchestrate ORB-N --single`.
+Linear is the source of truth for product work in this repo and orbit-api; GitHub Issues holds orbit-landing-page, infra chores, and Dependabot (D1). The ticket is the prompt (D2); one ticket = one repo = one reviewable PR, target under 400 lines (D4), and cross-repo work uses an API ticket blocking a UI ticket. The worker engine and its engine-specific model tiers live in `.claude/orchestrator.json` (D5); a `visible-effect` ticket needs final screenshots, a critique artifact, and test output before In Review (D7). `RENDER-CORRECTNESS.md` defines the bounded self-critique after capture. Invoke `tools/` scripts through their skills or agents; after `/next`, run `/orchestrate ORB-N --single`.
- `/feature`
- `/ticket`
diff --git a/tools/README.md b/tools/README.md
index e66221fd3c..be5c93fb5e 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -44,6 +44,7 @@ Read `CONVENTIONS.md` before adding one. Use the `/make-tool` skill to scaffold
| `worker-status.mjs` | The mechanical answer to "is the worker actually done", because tui-idle means stopped, not finished. Derives the verdict from artifacts (commits above the freshly fetched `origin/`, a clean worktree, the branch pushed, a PR open against the target, the issue In Review with the PR attached, an image attached when `visible-effect`, D7) and exits 1 listing exactly what is unmet. | `node tools/worker-status.mjs --worktree --issue ORB-N` (`--base`, `--json`, `--help`) |
| `worker-watch.mjs` | The LIVENESS half of babysitting, alongside `worker-status.mjs`'s delivery verdict: for every Orca worktree in the Orbit repos, the ticket, branch, Linear state, BUSY or IDLE classified by repaint delta across two `terminal list` samples, the last meaningful output lines with TUI repaint noise stripped, and the contract verdict. Reports only; deciding what to send a stalled worker stays the orchestrator's judgement. Backs `/watch`. | `node tools/worker-watch.mjs` (`--repo`, `--lines`, `--no-contract`, `--json`, `--help`) |
| `pr-watch.mjs` | Polls one or more PRs until a state the caller has NOT already acted on and exits naming which transition fired (`gone`, `checks-failed`, `changes-requested`, `review-comment`, `approved`, `ready-to-merge`, `timeout`). A verdict counts only on the CURRENT head, so a stale review does not satisfy it, and `--acted` is the only thing that suppresses one: the terminal condition is "anything I have not handled", never an allowlist of remembered good states. Backs `/orchestrate` section 3. | `node tools/pr-watch.mjs --repo --pr [--acted =:]` (`--once`, `--help`) |
+| `lib/orchestrator-config.mjs` | Not a tool, the shared `.claude/orchestrator.json` reader and engine-neutral worker tier resolver. It maps `tier:cheap` and `tier:deep` through the selected engine, rejects legacy, unknown, conflicting, missing or unchanged mappings, and keeps config failures consistent across harness tools. | imported, never invoked |
| `lib/tui-repaint.mjs` | Not a tool, the one shared module: is this TUI mid-turn? Two `lastOutputAt` samples a window apart, since `--for tui-idle` reports satisfied on a working codex and the terminal text keeps stale output. Imported by `launch-worker.mjs`, `nudge-worker.mjs` and `worker-watch.mjs`; exercised through them. | imported, never invoked |
| `orca-web-port.mjs` | Assigns each linked Orca worktree a deterministic web port in the 3100-4099 window, detects a collision before persisting it, reports the assigned port, and starts Next on that port. The root checkout reports the unchanged default 3000. | `node tools/orca-web-port.mjs --setup` on worktree creation; `node tools/orca-web-port.mjs` to report; `npm run web` to start Next |
diff --git a/tools/context-budget.json b/tools/context-budget.json
index 96ee479ac3..f1d1db7b65 100644
--- a/tools/context-budget.json
+++ b/tools/context-budget.json
@@ -1,7 +1,7 @@
{
- "bytes": 15488,
+ "bytes": 15523,
"files": {
- "CLAUDE.md": 12105,
+ "CLAUDE.md": 12140,
".claude/rules/core.md": 3383
}
}
diff --git a/tools/launch-worker.mjs b/tools/launch-worker.mjs
index a3c7b906dc..1ef664aa67 100644
--- a/tools/launch-worker.mjs
+++ b/tools/launch-worker.mjs
@@ -21,6 +21,7 @@ import { execFileSync, spawnSync } from "node:child_process"
import { appendFileSync, existsSync, readFileSync, statSync } from "node:fs"
import { basename, resolve } from "node:path"
+import { readOrchestratorConfig, resolveWorkerInvocation } from "./lib/orchestrator-config.mjs"
import { SETTLE_MS, isRepainting, pause } from "./lib/tui-repaint.mjs"
const USAGE = `usage: launch-worker.mjs --issue ORB-N --prompt-file [options]
@@ -348,9 +349,9 @@ if (statSync(promptFile).size === 0) fail(2, `prompt file is empty: ${promptFile
let config
try {
- config = JSON.parse(readFileSync(new URL("../.claude/orchestrator.json", import.meta.url), "utf8"))
+ config = readOrchestratorConfig()
} catch (error) {
- fail(2, `.claude/orchestrator.json could not be read as JSON: ${error.message}`)
+ fail(2, error.message)
}
const engineName = config.worker
const engine = config.workers?.[engineName]
@@ -399,9 +400,12 @@ const worktreeName = `${issue.toLowerCase()}-${slug}`
const branch = `${branchPrefix}/${worktreeName}`
const comment = argOf("--comment") ?? `${issue} launched: worker running`
-/** Model routing: a worker:sonnet ticket swaps the configured opus for sonnet, nothing else. */
-const wantsSonnet = labels.includes("worker:sonnet")
-const engineArgs = engine.args.map((arg, index) => (wantsSonnet && engine.args[index - 1] === "--model" && arg === "opus" ? "sonnet" : arg))
+let engineArgs
+try {
+ engineArgs = resolveWorkerInvocation(engineName, engine, labels).args
+} catch (error) {
+ fail(2, error.message)
+}
const command = [engine.command, ...engineArgs].join(" ")
/**
diff --git a/tools/lib/orchestrator-config.mjs b/tools/lib/orchestrator-config.mjs
new file mode 100644
index 0000000000..d6990d71ea
--- /dev/null
+++ b/tools/lib/orchestrator-config.mjs
@@ -0,0 +1,91 @@
+import { readFileSync } from "node:fs"
+
+const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
+
+const sameArgs = (first, second) =>
+ first.length === second.length && first.every((argument, index) => argument === second[index])
+
+const modelEntry = (engineName, models, tier) => {
+ const entry = models[tier]
+ if (
+ !isRecord(entry) ||
+ typeof entry.model !== "string" ||
+ entry.model.trim().length === 0 ||
+ (entry.args !== undefined && (!Array.isArray(entry.args) || entry.args.some((argument) => typeof argument !== "string")))
+ ) {
+ throw new Error(
+ `worker engine "${engineName}" has an invalid models.${tier} mapping; expected { model: string, args?: string[] }`,
+ )
+ }
+ return entry
+}
+
+const invocationFor = (baseArgs, entry) => [...baseArgs, ...(entry.args ?? []), "--model", entry.model]
+
+export const readOrchestratorConfig = (
+ configUrl = new URL("../../.claude/orchestrator.json", import.meta.url),
+) => {
+ try {
+ return JSON.parse(readFileSync(configUrl, "utf8"))
+ } catch (error) {
+ throw new Error(`.claude/orchestrator.json could not be read as JSON: ${error.message}`)
+ }
+}
+
+export const resolveWorkerInvocation = (engineName, engine, labels) => {
+ if (labels.includes("worker:sonnet")) {
+ throw new Error('worker:sonnet is no longer supported; replace it with "tier:cheap"')
+ }
+ if (!isRecord(engine)) {
+ throw new Error(`worker engine "${engineName}" is missing from .claude/orchestrator.json`)
+ }
+ if (
+ !Array.isArray(engine.args) ||
+ engine.args.some((argument) => typeof argument !== "string") ||
+ engine.args.some((argument) => argument === "--model" || argument === "-m" || argument.startsWith("--model="))
+ ) {
+ throw new Error(`worker engine "${engineName}" must declare args as an array of non-model strings`)
+ }
+ if (!isRecord(engine.models) || !Object.hasOwn(engine.models, "default")) {
+ throw new Error(
+ `worker engine "${engineName}" has an invalid models.default mapping; expected { model: string, args?: string[] }`,
+ )
+ }
+ for (const requiredTier of ["cheap", "deep"]) {
+ if (!Object.hasOwn(engine.models, requiredTier)) {
+ throw new Error(`worker engine "${engineName}" is missing its models.${requiredTier} mapping`)
+ }
+ }
+
+ const declaredTiers = Object.keys(engine.models).filter((tier) => tier !== "default")
+ const entries = new Map(
+ ["default", ...declaredTiers].map((tier) => [tier, modelEntry(engineName, engine.models, tier)]),
+ )
+ const tierLabels = [...new Set(labels.filter((label) => label.startsWith("tier:")))]
+ if (tierLabels.length > 1) {
+ throw new Error(`conflicting worker tier labels: ${tierLabels.join(", ")}`)
+ }
+
+ const tier = tierLabels[0]?.slice("tier:".length) ?? "default"
+ if (!entries.has(tier)) {
+ const available = declaredTiers.map((declaredTier) => `tier:${declaredTier}`).join(", ") || "none"
+ throw new Error(
+ `worker engine "${engineName}" does not declare tier:${tier}; declared tiers: ${available}`,
+ )
+ }
+
+ const cheapArgs = entries.has("cheap") ? invocationFor(engine.args, entries.get("cheap")) : null
+ const deepArgs = entries.has("deep") ? invocationFor(engine.args, entries.get("deep")) : null
+ if (cheapArgs && deepArgs && sameArgs(cheapArgs, deepArgs)) {
+ throw new Error(`worker engine "${engineName}" resolves tier:cheap and tier:deep to identical invocations`)
+ }
+
+ const args = invocationFor(engine.args, entries.get(tier))
+ const defaultArgs = invocationFor(engine.args, entries.get("default"))
+ if (tier !== "default" && sameArgs(args, defaultArgs)) {
+ throw new Error(
+ `worker engine "${engineName}" resolves tier:${tier} to the same invocation as its default model`,
+ )
+ }
+ return { tier, args }
+}
diff --git a/tools/nudge-worker.mjs b/tools/nudge-worker.mjs
index 1b29f8548c..6f479ceff8 100644
--- a/tools/nudge-worker.mjs
+++ b/tools/nudge-worker.mjs
@@ -15,6 +15,7 @@ import { execFileSync, spawnSync } from "node:child_process"
import { appendFileSync, existsSync, readFileSync } from "node:fs"
import { resolve } from "node:path"
+import { readOrchestratorConfig } from "./lib/orchestrator-config.mjs"
import { SETTLE_MS, isRepainting, pause } from "./lib/tui-repaint.mjs"
const USAGE = `usage: nudge-worker.mjs --terminal (--text "" | --prompt-file < update.md)
@@ -75,14 +76,6 @@ const argOf = (flag) => {
return index === -1 ? null : process.argv[index + 1]
}
-const readOrchestratorConfig = () => {
- try {
- return { config: JSON.parse(readFileSync(new URL("../.claude/orchestrator.json", import.meta.url), "utf8")), error: null }
- } catch (error) {
- return { config: null, error: error.message }
- }
-}
-
/** orca prints its `ok: false` payload on STDOUT and leaves stderr empty, so a failed call whose
* reason is only read off stderr reports "Command failed" and nothing else. Read stdout first. */
const orcaFailureReason = (error) => {
@@ -172,7 +165,12 @@ if (promptFileArg && textArg) fail(2, "--prompt-file and --text are alternatives
if (!Number.isInteger(waitAttemptsAllowed) || waitAttemptsAllowed < 1) fail(2, "--wait-attempts must be a positive integer")
if (textArg && /[\r\n]/.test(textArg)) fail(2, "--text must be a single line; append the long form to the prompt file instead")
-const orchestrator = readOrchestratorConfig()
+let orchestrator
+try {
+ orchestrator = { config: readOrchestratorConfig(), error: null }
+} catch (error) {
+ orchestrator = { config: null, error: error.message }
+}
const engineSource = engineOverridePresent ? "--engine" : ".claude/orchestrator.json worker"
const engineValue = engineOverridePresent ? engineOverride : orchestrator.config?.worker
const normalizedEngine = typeof engineValue === "string" ? engineValue.trim().toLowerCase() : ""
@@ -236,7 +234,7 @@ let update = ""
if (promptFileArg) {
promptFile = resolve(promptFileArg)
if (!existsSync(promptFile)) fail(2, `prompt file not found: ${promptFile}`)
- if (!orchestrator.config) fail(2, `.claude/orchestrator.json could not be read as JSON: ${orchestrator.error}`)
+ if (!orchestrator.config) fail(2, orchestrator.error)
const repos = orchestrator.config.repos
const normalize = (path) => path.replaceAll("\\", "/").replace(/\/+$/, "").toLowerCase()
for (const [key, path] of Object.entries(repos ?? {})) {
diff --git a/tools/test-tools.mjs b/tools/test-tools.mjs
index 66e7403296..4133e1f4a1 100644
--- a/tools/test-tools.mjs
+++ b/tools/test-tools.mjs
@@ -422,8 +422,23 @@ const orchestratorConfig = (repoPath, worker, engineName) =>
repos: { ui: repoPath },
})
-const INTERACTIVE_WORKER = { command: "claude", args: ["--permission-mode", "bypassPermissions", "--model", "opus"], interactive: true }
-const INTERACTIVE_CODEX = { command: "codex", args: ["-c", 'windows.sandbox="unelevated"', "--dangerously-bypass-approvals-and-sandbox"], interactive: true }
+const CLAUDE_MODELS = {
+ default: { model: "opus" },
+ cheap: { model: "sonnet" },
+ deep: { model: "opus", args: ["--effort", "max"] },
+}
+const CODEX_MODELS = {
+ default: { model: "gpt-5.6-sol", args: ["-c", 'model_reasoning_effort="high"'] },
+ cheap: { model: "gpt-5.6-luna", args: ["-c", 'model_reasoning_effort="low"'] },
+ deep: { model: "gpt-5.6-sol", args: ["-c", 'model_reasoning_effort="max"'] },
+}
+const INTERACTIVE_WORKER = { command: "claude", args: ["--permission-mode", "bypassPermissions"], models: CLAUDE_MODELS, interactive: true }
+const INTERACTIVE_CODEX = {
+ command: "codex",
+ args: ["-c", 'windows.sandbox="unelevated"', "--dangerously-bypass-approvals-and-sandbox"],
+ models: CODEX_MODELS,
+ interactive: true,
+}
/**
* Stages a private copy of launch-worker.mjs beside a hand-written
@@ -503,7 +518,7 @@ const REQUIRED_CONTRACT_CLAUSES = {
*/
const TRUST_SCREENS = {
claude: {
- engine: { command: "claude", args: ["--permission-mode", "bypassPermissions"], interactive: true },
+ engine: INTERACTIVE_WORKER,
answer: "1",
/**
* ONE screen per alternative the profile claims to recognise, each phrased so that only
@@ -519,7 +534,7 @@ const TRUST_SCREENS = {
],
},
codex: {
- engine: { command: "codex", args: ["--dangerously-bypass-approvals-and-sandbox"], interactive: true },
+ engine: INTERACTIVE_CODEX,
answer: "",
screens: [{ label: "the trust-the-contents wording", tail: "You are in C:\\wt\nDoyoutrustthecontentsofthisdirectory?\n> 1. Yes, continue2.No,quitPress enter to continue" }],
},
@@ -777,9 +792,62 @@ const launchWorkerCases = () => {
const promptFile = stage("prompt.md", "the ticket body verbatim\n")
const good = stageLaunchWorker("interactive", INTERACTIVE_WORKER)
+ const claudeDefault = check(
+ "launch-worker.mjs",
+ "Claude defaults to opus",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /claude[\s\S]*--model opus/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui"])) },
+ )
+ const claudeCheap = check(
+ "launch-worker.mjs",
+ "tier:cheap selects sonnet on Claude",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /claude[\s\S]*--model sonnet/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:cheap"])) },
+ )
+ const claudeDeep = check(
+ "launch-worker.mjs",
+ "tier:deep selects a distinct max-effort opus invocation on Claude",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /claude[\s\S]*--effort max[\s\S]*--model opus/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:deep"])) },
+ )
+ const claudeDefaultCommand = claudeDefault.status === 0 ? JSON.parse(claudeDefault.stdout).command : ""
+ const claudeCheapCommand = claudeCheap.status === 0 ? JSON.parse(claudeCheap.stdout).command : ""
+ const claudeDeepCommand = claudeDeep.status === 0 ? JSON.parse(claudeDeep.stdout).command : ""
+ T("launch-worker.mjs: Claude cheap tier cannot resolve to the unchanged default invocation", claudeCheapCommand !== claudeDefaultCommand, `default and cheap both resolved to: ${claudeDefaultCommand}`)
+ T("launch-worker.mjs: Claude deep tier cannot resolve to the unchanged default invocation", claudeDeepCommand !== claudeDefaultCommand, `default and deep both resolved to: ${claudeDefaultCommand}`)
+ check(
+ "launch-worker.mjs",
+ "an unknown tier lists the engine's declared cheap and deep tiers",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 2, stderr: /fast[\s\S]*cheap[\s\S]*deep/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:fast"])) },
+ )
+ check(
+ "launch-worker.mjs",
+ "a codex-only or unknown tier is rejected on Claude",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 2, stderr: /codex-only[\s\S]*cheap[\s\S]*deep/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:codex-only"])) },
+ )
+ check(
+ "launch-worker.mjs",
+ "rejects the legacy worker:sonnet label with tier:cheap remediation",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 2, stderr: /worker:sonnet[\s\S]*tier:cheap/ },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "worker:sonnet"])) },
+ )
+ check(
+ "launch-worker.mjs",
+ "rejects conflicting tier labels",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 2, stderr: /conflict|multiple[\s\S]*tier/i },
+ { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:cheap", "tier:deep"])) },
+ )
check("launch-worker.mjs", "resolves the repo from the repo:* label", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 0, stdout: /"repo": "ui"/ }, { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
check("launch-worker.mjs", "derives the contract branch from the title", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 0, stdout: /"branch": "feature\/orb-75-prove-the-harness-gate/ }, { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- check("launch-worker.mjs", "worker:sonnet swaps the configured opus", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 0, stdout: /--model sonnet/ }, { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui", "worker:sonnet"])) })
check("launch-worker.mjs", "refuses a repo:* label with no repos entry", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /no repo path for "zzz"/ }, { path: good.path, env: orcaEnv(linearIssueStub(["repo:zzz"])) })
check("launch-worker.mjs", "refuses a ticket with no repo:* label and no --repo", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /carries no repo:\* label/ }, { path: good.path, env: orcaEnv(linearIssueStub([])) })
@@ -787,23 +855,81 @@ const launchWorkerCases = () => {
writeFileSync(insidePrompt, "the ticket body verbatim\n")
check("launch-worker.mjs", "refuses a prompt file inside a repo", ["--issue", "ORB-75", "--prompt-file", insidePrompt, "--dry-run"], { status: 2, stderr: /would be committed/ }, { path: good.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+ const noModels = stageLaunchWorker("no-models", { command: "claude", args: ["--permission-mode", "bypassPermissions"], interactive: true })
+ check("launch-worker.mjs", "refuses an engine with no models map", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /claude[\s\S]*models/ }, { path: noModels.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const noDefault = stageLaunchWorker("no-default-model", { ...INTERACTIVE_WORKER, models: { cheap: CLAUDE_MODELS.cheap, deep: CLAUDE_MODELS.deep } })
+ check("launch-worker.mjs", "refuses an engine model map with no default", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /claude[\s\S]*default/ }, { path: noDefault.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const modelInBaseArgs = stageLaunchWorker("model-in-base-args", { ...INTERACTIVE_WORKER, args: ["--model", "opus"] })
+ check("launch-worker.mjs", "refuses a model flag in the engine's base args", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /non-model strings/ }, { path: modelInBaseArgs.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const noCheap = stageLaunchWorker("no-cheap-model", { ...INTERACTIVE_WORKER, models: { default: CLAUDE_MODELS.default, deep: CLAUDE_MODELS.deep } })
+ check("launch-worker.mjs", "refuses an engine model map with no cheap tier", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /claude[\s\S]*cheap/ }, { path: noCheap.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const noDeep = stageLaunchWorker("no-deep-model", { ...INTERACTIVE_WORKER, models: { default: CLAUDE_MODELS.default, cheap: CLAUDE_MODELS.cheap } })
+ check("launch-worker.mjs", "refuses an engine model map with no deep tier", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /claude[\s\S]*deep/ }, { path: noDeep.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const identicalTiers = stageLaunchWorker("identical-tiers", {
+ ...INTERACTIVE_WORKER,
+ models: { ...CLAUDE_MODELS, cheap: { model: "sonnet" }, deep: { model: "sonnet" } },
+ })
+ check("launch-worker.mjs", "refuses identical cheap and deep mappings", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /cheap[\s\S]*deep|deep[\s\S]*cheap/ }, { path: identicalTiers.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+
+ const unchangedCheap = stageLaunchWorker("unchanged-cheap", {
+ ...INTERACTIVE_WORKER,
+ models: { ...CLAUDE_MODELS, cheap: { model: "opus" } },
+ })
+ check(
+ "launch-worker.mjs",
+ "refuses a selected non-default tier identical to the default",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 2, stderr: /cheap[\s\S]*default|default[\s\S]*cheap/ },
+ { path: unchangedCheap.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:cheap"])) },
+ )
+
const notInteractive = stageLaunchWorker("not-interactive", { ...INTERACTIVE_WORKER, interactive: false })
check("launch-worker.mjs", "refuses an engine declaring interactive: false", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /does not declare interactive: true/ }, { path: notInteractive.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const omitted = stageLaunchWorker("omits-interactive", { command: "claude", args: ["--model", "opus"] })
+ const omitted = stageLaunchWorker("omits-interactive", { command: "claude", args: [], models: CLAUDE_MODELS })
check("launch-worker.mjs", "refuses an engine that omits interactive entirely", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /does not declare interactive: true/ }, { path: omitted.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const headless = stageLaunchWorker("headless-args", { command: "claude", args: ["-p", "--model", "opus"], interactive: true })
+ const headless = stageLaunchWorker("headless-args", { ...INTERACTIVE_WORKER, args: ["-p"] })
check("launch-worker.mjs", "refuses headless args behind an interactive declaration", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /headless invocation/ }, { path: headless.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const headlessCommand = stageLaunchWorker("headless-command", { command: "claude --print", args: [], interactive: true })
+ const headlessCommand = stageLaunchWorker("headless-command", { ...INTERACTIVE_WORKER, command: "claude --print", args: [] })
check("launch-worker.mjs", "refuses a headless token hidden in the command field", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /headless invocation/ }, { path: headlessCommand.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
// Headless is a property of the CLI, not of the harness: codex's -p is --profile, an
// interactive flag, while claude's -p is --print. One shared token list cannot tell them
// apart, so these five cases pin both halves of the per-engine split.
const codex = stageLaunchWorker("codex-interactive", INTERACTIVE_CODEX, "codex")
- const codexPlan = check("launch-worker.mjs", "an interactive codex entry launches", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 0, stdout: /"engine": "codex"/ }, { path: codex.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
+ const codexPlan = check(
+ "launch-worker.mjs",
+ "Codex defaults to Sol at high effort",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /codex[\s\S]*model_reasoning_effort[\s\S]*high[\s\S]*--model gpt-5\.6-sol/ },
+ { path: codex.path, env: orcaEnv(linearIssueStub(["repo:ui"])) },
+ )
+ const codexCheap = check(
+ "launch-worker.mjs",
+ "tier:cheap selects Luna at low effort on Codex",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /codex[\s\S]*model_reasoning_effort[\s\S]*low[\s\S]*--model gpt-5\.6-luna/ },
+ { path: codex.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:cheap"])) },
+ )
+ const codexDeep = check(
+ "launch-worker.mjs",
+ "tier:deep selects Sol at max effort on Codex",
+ ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"],
+ { status: 0, stdout: /codex[\s\S]*model_reasoning_effort[\s\S]*max[\s\S]*--model gpt-5\.6-sol/ },
+ { path: codex.path, env: orcaEnv(linearIssueStub(["repo:ui", "tier:deep"])) },
+ )
+ const codexDefaultCommand = codexPlan.status === 0 ? JSON.parse(codexPlan.stdout).command : ""
+ const codexCheapCommand = codexCheap.status === 0 ? JSON.parse(codexCheap.stdout).command : ""
+ const codexDeepCommand = codexDeep.status === 0 ? JSON.parse(codexDeep.stdout).command : ""
+ T("launch-worker.mjs: Codex cheap tier cannot resolve to the unchanged default invocation", codexCheapCommand !== codexDefaultCommand, `default and cheap both resolved to: ${codexDefaultCommand}`)
+ T("launch-worker.mjs: Codex deep tier cannot resolve to the unchanged default invocation", codexDeepCommand !== codexDefaultCommand, `default and deep both resolved to: ${codexDefaultCommand}`)
T(
"launch-worker.mjs: the codex plan's command carries no headless token",
codexPlan.status === 0 && !/(^|\s)(-p|--print|exec|e)(\s|"|$)/.test(JSON.parse(codexPlan.stdout).command),
@@ -813,13 +939,13 @@ const launchWorkerCases = () => {
const codexProfile = stageLaunchWorker("codex-profile", { ...INTERACTIVE_CODEX, args: ["-p", "my-profile"] }, "codex")
check("launch-worker.mjs", "accepts codex -p, which is --profile and not --print", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 0, stdout: /codex -p my-profile/ }, { path: codexProfile.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const codexExec = stageLaunchWorker("codex-exec", { command: "codex", args: ["exec", "--full-auto"], interactive: true }, "codex")
+ const codexExec = stageLaunchWorker("codex-exec", { ...INTERACTIVE_CODEX, args: ["exec", "--full-auto"] }, "codex")
check("launch-worker.mjs", "still refuses codex exec behind an interactive declaration", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /carries "exec", which is a headless invocation of codex/ }, { path: codexExec.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const codexExecAlias = stageLaunchWorker("codex-exec-alias", { command: "codex", args: ["e"], interactive: true }, "codex")
+ const codexExecAlias = stageLaunchWorker("codex-exec-alias", { ...INTERACTIVE_CODEX, args: ["e"] }, "codex")
check("launch-worker.mjs", "refuses codex e, the documented alias for exec", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /headless invocation of codex/ }, { path: codexExecAlias.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
- const unknownEngine = stageLaunchWorker("unknown-engine", { command: "aider", args: [], interactive: true }, "aider")
+ const unknownEngine = stageLaunchWorker("unknown-engine", { command: "aider", args: [], models: CLAUDE_MODELS, interactive: true }, "aider")
check("launch-worker.mjs", "refuses an engine binary with no profile rather than waving it through", ["--issue", "ORB-75", "--prompt-file", promptFile, "--dry-run"], { status: 2, stderr: /no engine profile for/ }, { path: unknownEngine.path, env: orcaEnv(linearIssueStub(["repo:ui"])) })
check("launch-worker.mjs", "refuses a missing prompt file", ["--issue", "ORB-75", "--prompt-file", join(root, "absent.md"), "--dry-run"], { status: 2, stderr: /prompt file not found/ }, { path: good.path })
diff --git a/tools/wave-plan.mjs b/tools/wave-plan.mjs
index 4f75fcd7c7..64c0c14690 100644
--- a/tools/wave-plan.mjs
+++ b/tools/wave-plan.mjs
@@ -12,7 +12,8 @@
import { execFile } from "node:child_process"
import { promisify } from "node:util"
-import { readFileSync } from "node:fs"
+
+import { readOrchestratorConfig } from "./lib/orchestrator-config.mjs"
const USAGE = `usage: wave-plan.mjs --project "" | --label "