opencode-model-router 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +364 -0
- package/README.md +20 -0
- package/package.json +5 -1
- package/src/commands/output.ts +23 -1
- package/src/compat/background.ts +2439 -0
- package/src/compat/child-session.ts +6 -0
- package/src/compat/turn-state.ts +215 -0
- package/src/compat/v2-client.ts +136 -17
- package/src/compat/v2-hooks.ts +2656 -114
- package/src/compat/v2-observations.ts +328 -0
- package/src/executor/capacity.ts +362 -0
- package/src/executor/child-guards.ts +40 -0
- package/src/executor/command.ts +265 -0
- package/src/executor/compile/edges.ts +809 -0
- package/src/executor/compile/estimate.ts +158 -0
- package/src/executor/compile/footprint.ts +829 -0
- package/src/executor/compile/index.ts +1080 -0
- package/src/executor/compile/parse.ts +1492 -0
- package/src/executor/compile/residue.ts +706 -0
- package/src/executor/compile/validate.ts +280 -0
- package/src/executor/create.ts +672 -0
- package/src/executor/expand.ts +551 -0
- package/src/executor/git.ts +1214 -0
- package/src/executor/host-preamble.ts +17 -0
- package/src/executor/instructions.ts +35 -0
- package/src/executor/integrate/bisect.ts +73 -0
- package/src/executor/integrate/checks.ts +1086 -0
- package/src/executor/integrate/land.ts +177 -0
- package/src/executor/integrate/phase-suite.ts +407 -0
- package/src/executor/integrate/queue.ts +3083 -0
- package/src/executor/integrate/run-resolver.ts +19 -0
- package/src/executor/launch.ts +652 -0
- package/src/executor/ledger.ts +2208 -0
- package/src/executor/observations.ts +212 -0
- package/src/executor/paths.ts +159 -0
- package/src/executor/platform.ts +39 -0
- package/src/executor/process-identity.ts +19 -0
- package/src/executor/qa-loop.ts +470 -0
- package/src/executor/recovery.ts +403 -0
- package/src/executor/runtime.ts +6233 -0
- package/src/executor/schedule.ts +246 -0
- package/src/executor/slots/env.ts +145 -0
- package/src/executor/slots/pool.ts +1564 -0
- package/src/executor/slots/provision.ts +853 -0
- package/src/executor/tool.ts +534 -0
- package/src/executor/types.ts +2064 -0
- package/src/executor/unattended.ts +488 -0
- package/src/guard/store.ts +3 -1
- package/src/index.ts +1498 -288
- package/src/router/config.ts +776 -25
- package/src/router/git-tools.ts +106 -15
- package/src/router/leases.ts +1469 -0
- package/src/router/logger.ts +44 -32
- package/src/router/protocol.ts +40 -10
- package/src/router/role-agents.ts +224 -17
- package/src/router/roles-config.ts +10 -1
- package/src/router/roles.ts +1 -1
- package/src/router/run-tools.ts +56 -4
- package/src/router/tool-paths.ts +308 -0
- package/src/router/work-roots.ts +86 -0
- package/src/routing/advisor/findings.ts +25 -5
- package/src/routing/classify/index.ts +7 -1
- package/src/routing/classify/rules.ts +11 -0
- package/src/routing/commands/stats.ts +2 -2
- package/src/routing/outcomes/durations.ts +225 -0
- package/src/routing/outcomes/index.ts +59 -2
- package/src/routing/outcomes/persist.ts +409 -0
- package/src/routing/outcomes/stats.ts +170 -11
- package/src/routing/outcomes/timings.ts +836 -0
- package/src/routing/outcomes/types.ts +98 -0
- package/src/routing/roles/approvals.ts +86 -5
- package/src/routing/roles/binding.ts +99 -9
- package/src/routing/roles/orphans.ts +68 -0
- package/src/routing/roles/policy.ts +21 -3
- package/src/routing/roles/work-root.ts +3 -1
- package/src/routing/wire/dispatch.ts +86 -12
- package/src/routing/wire/hint.ts +56 -8
- package/src/v2.ts +94 -49
- package/src/verify/branch.ts +8 -2
- package/src/verify/canonical-path.ts +35 -0
- package/src/verify/deterministic.ts +38 -9
- package/src/verify/dispatch.ts +64 -28
- package/src/verify/exec.ts +52 -9
- package/src/verify/pending.ts +1691 -10
- package/src/verify/perimeter.ts +12 -6
- package/src/verify/plan-task.ts +729 -0
- package/src/verify/reference.ts +216 -3
- package/src/verify/tree.ts +30 -13
- package/src/verify/types.ts +9 -2
- package/src/verify/wiring.ts +290 -31
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,370 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.9.0] - 2026-10-25
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **OpenCode v2: `routing.orphans.resume`**, `"refuse"` by default or `"allow"` to skip the early stale-role-resume check.
|
|
15
|
+
A bounded process-wide registry tracks refused resumes and lost role dispatches; the first refusal warns, later
|
|
16
|
+
ones log at debug. Binding-lookup failures share a separate process-once warning, then log at debug. Inert on v1,
|
|
17
|
+
where the existing v2-only-features notice also names orphan cleanup.
|
|
18
|
+
- **OpenCode v2: role-dispatch decision rows record where their risk came from.** `trace.riskSources` lists the class
|
|
19
|
+
base risk, the rules estimate, the route line's `risk=` claim, the merged facts, any inherited resume risk and the
|
|
20
|
+
effective risk, plus an optional bounded vocabulary label (a single word or a table id, never prompt text). Routing
|
|
21
|
+
is unchanged; older rows stay readable.
|
|
22
|
+
- **OpenCode v2: configurable `routing.roleFloor: "gated"`** (bundled `tiers.json` or global override, not project overrides;
|
|
23
|
+
code default `"strict"`). A role dispatch that may edit
|
|
24
|
+
and run commands, whose detection is `grader`, whose risk is not `high`, whose return gate runs and whose role can
|
|
25
|
+
be raised from `medium` straight to `heavy`, gets a `medium` authority floor instead of `heavy` (bounds reason
|
|
26
|
+
`gated:authority`, recorded only when gating lowers the final floor). A verification FAIL, and for gated children also
|
|
27
|
+
an UNVERIFIABLE return, raises the resumed child to `heavy`. Every other floor cell is unchanged; inert on OpenCode v1.
|
|
28
|
+
- **OpenCode v2: intrinsic service observations for the amended G8 oracle (A-6.1-1).** With the opt-in observations
|
|
29
|
+
below, verification checks/grading, integration rebase/checks/fast-forward and phase-suite commands emit paired
|
|
30
|
+
service spans that bracket only their execution; preparation, slot and lease waits, and retry backoff are recorded as
|
|
31
|
+
separate spans so they cannot inflate a bound term. Off by default and inert on OpenCode v1.
|
|
32
|
+
- **OpenCode v2: opt-in diagnostic observations.** Set `MODEL_ROUTER_V2_OBSERVATIONS=<directory>` to an existing
|
|
33
|
+
directory before setup to write bounded, sequence-numbered JSONL streams, sealed on adapter disposal. They
|
|
34
|
+
record dispatch native-argument fingerprints, completion effects, scheduler and physical-slot transitions,
|
|
35
|
+
without prompt or file content. Off by default and inert on OpenCode v1.
|
|
36
|
+
- **CPX e2e smoke diagnostics:** bounded wrapper/child-command timings and host/setup/launch checkpoints are
|
|
37
|
+
retained with failure evidence before scratch cleanup. These are diagnostic observations only; executor
|
|
38
|
+
behavior, offline checks and G1–G12 bounds are unchanged.
|
|
39
|
+
- **CPX soak: `npm run soak:analyze` offline soak analyzer (amendment A-6.1-3).** It reads retained soak evidence and
|
|
40
|
+
reports observations, violations and per-criterion and per-subcase status. Subcases the current logs cannot show
|
|
41
|
+
are reported as `not-observable` declared gaps, never as passes (A-6.1-6); an overall passing verdict requires at least
|
|
42
|
+
five working days and every required criterion to be `ok`. Absence of evidence is never a pass.
|
|
43
|
+
- **OpenCode v2: `/router stats` shows a "Dispatch durations" table and an "Orchestrator cache-read share" line** when
|
|
44
|
+
timing logs exist.
|
|
45
|
+
- **OpenCode v2: background dispatch.** A subagent dispatch whose predicted duration is long runs in the background
|
|
46
|
+
(`routing.background.mode`: `auto` decides from the predicted duration, `model` lets the orchestrating model decide,
|
|
47
|
+
`off` keeps every dispatch in the foreground as before; `routing.background.minPredictedMs` sets the `auto` threshold).
|
|
48
|
+
The router state lists the dispatches in flight and those completed since the last turn, and the router guarantees
|
|
49
|
+
apply when a background child completes.
|
|
50
|
+
- **OpenCode v2: held results with verdict delivery.** The result of a background dispatch that requires verification
|
|
51
|
+
is held: the orchestrator sees a placeholder until the verification gate settles, a resume of the held child is
|
|
52
|
+
refused, and the verdict is posted to the orchestrator's session. A held result whose gate gives no verdict (a
|
|
53
|
+
failed or interrupted child, no verification required, an error in the gate, a restart that lost the verification
|
|
54
|
+
data) is posted as `UNVERIFIABLE` with its reason, never as `PASS`. `router_verify` refuses a held handle: its own
|
|
55
|
+
gate posts the verdict.
|
|
56
|
+
- **OpenCode v2: work leases** (`routing.leases.mode`, `routing.leases.run`). A child session holds a lease on each
|
|
57
|
+
file it edits in its checkout; another child's edit of that file in the same checkout is refused until the lease is
|
|
58
|
+
released (a plan task's lease also refuses another plan task's edit of that path in any linked worktree), search
|
|
59
|
+
results under another holder's edit are omitted, and `router_run` annotates or refuses a run on a leased target.
|
|
60
|
+
- **OpenCode v2: restart recovery.** In-flight dispatches, held results and pending verifications are journaled in
|
|
61
|
+
`pending.jsonl` in the per-user state directory (`~/.local/state/opencode-model-router`, or
|
|
62
|
+
`$XDG_STATE_HOME/opencode-model-router` when set, outside Windows), never in the temp directory. `/router approve`
|
|
63
|
+
refuses that directory and any repository inside it (a protected location). After a restart the router recovers a
|
|
64
|
+
dispatch whose child finished, re-posts a verdict that was reached but not delivered, and keeps posted results
|
|
65
|
+
hidden. A restored pending verification keeps its cross-repo checks: the branch and HEAD recorded at return, the
|
|
66
|
+
unobservable writers and the check placements of a deferred dispatch are journaled and checked again, and a record
|
|
67
|
+
with a malformed one is dropped. A dispatch's perimeter is not journaled, so `router_verify` on a restored handle
|
|
68
|
+
whose dispatch had one reports `UNVERIFIABLE` (`perimeter lost in restart`), never `PASS`. A held result's
|
|
69
|
+
dispatch-time head is journaled and checked again: a held result whose head or perimeter was lost settles
|
|
70
|
+
`UNVERIFIABLE`, and a restored held result settles in place. A journal that vanishes under a running process is
|
|
71
|
+
rewritten from memory. OpenCode v1 ignores every `routing.background.*` and `routing.leases.*` key and logs one
|
|
72
|
+
notice per process that names them.
|
|
73
|
+
- **OpenCode v2: the plan executor is Windows only in this release.** Its execution slots need a drive-letter path
|
|
74
|
+
(`routing.executor.slotsDir`, default `<drive>:\.omr-slots\<planId>`). On platforms other than Windows it is inert:
|
|
75
|
+
`router_plan` and `/plan` are not registered, `/router` does not list `/plan`, role agents get no slots rule and no
|
|
76
|
+
executor-home lookup runs (`<git common dir>/omr-executor`, found on disk without running git, is still denied to
|
|
77
|
+
them whenever the common directory resolves, even before it exists), invalid `routing.executor.*` values are not reported, no executor discovery runs at start, and when
|
|
78
|
+
roles mode at start with enforced leases and verification not `never` would assemble it the router logs one notice
|
|
79
|
+
per process, `plan executor requires Windows; router_plan and /plan are not registered`.
|
|
80
|
+
- **OpenCode v2: plan executor registration.** `router_plan` and `/plan` are registered only in roles mode selected at
|
|
81
|
+
start, and `router_plan` resolves the executor at call time; `/router` lists `/plan` only when it is registered, not
|
|
82
|
+
user-defined, and the executor prerequisites hold (roles delegation, enforced leases, verification not `never`, a
|
|
83
|
+
location inside `routing.workRoots` when configured). State-changing and authority actions (`compile`, `residue`, `approve`, `adopt`, `abort`, `purge`, `land`,
|
|
84
|
+
`answer`, `pause`, `resume`, `add-tasks`, `done`, `gc`, and any other state-changing action) require a proven
|
|
85
|
+
depth-0 session with no parent, with no bound-plan-child exception; failed parent lookups refuse. Read-only
|
|
86
|
+
`status`, `ready`, `export` and `/plan inbox` allow roots or exactly bound plan children reading only their own
|
|
87
|
+
explicitly named plan, never another plan. The same rule guards the tool and command. An existing user-defined
|
|
88
|
+
`/plan` is preserved: v2 checks the host command registry, logs one conflict warning and keeps `router_plan` available;
|
|
89
|
+
v1 adds no `/plan` notice for that user command. Active plans add executor instructions to router state after the plan
|
|
90
|
+
section. Assembly requires a git repository, roles delegation, enforced leases and a plan-task verifier with
|
|
91
|
+
verification enabled; otherwise the tool and command report why the executor is unavailable. The keys, tool and
|
|
92
|
+
command have a user guide ([docs/EXECUTOR.md](docs/EXECUTOR.md)) and a design record
|
|
93
|
+
([ADR 0007](docs/adr/0007-critical-path-execution.md)); `slotsDir`, `integrationChecks`, `phaseSuite`,
|
|
94
|
+
`provision` and `python` are trusted keys that only the global override sets. `/router approve` refuses a repository's
|
|
95
|
+
executor home (`<git common dir>\omr-executor`, with its plan and slot-marker directories) and any repository inside
|
|
96
|
+
it; that check runs git within one 15 s bound in all, and
|
|
97
|
+
refuses a candidate it could not finish in time. OpenCode v1 ignores every `routing.executor.*` key and logs one
|
|
98
|
+
notice per process that names them; a best-effort `/plan` use without a user-defined command shares that notice and
|
|
99
|
+
adds no output. The v1 tool, command and help maps are unchanged. Breaker answers and QA-cap `accept`/`fix` answers
|
|
100
|
+
that unpause a phase re-enqueue its verified tasks and wake the integration lanes, without duplicating queued entries
|
|
101
|
+
or bypassing task leases. Foreign plans attach read-only: startup and failed-adopt recovery check the ledger's
|
|
102
|
+
repository before opening a writer, so viewing a foreign plan takes no writer lock and changes no writer epoch or
|
|
103
|
+
journal. Status remains available; mutation requires that repository. The trusted slots root stays allowed after a
|
|
104
|
+
restart or `/router-reload` while slot and integration worktrees exist; roots inside or above a non-slot checkout are
|
|
105
|
+
refused, and the default slots drive comes from the location's repository toplevel; a registered worktree whose folder
|
|
106
|
+
is gone never blocks that allow. One executor runs per process: a plugin copy refused by the process claim waits and
|
|
107
|
+
assembles once the holder disposes, running recovery once, and is wired into the host exactly like an executor
|
|
108
|
+
assembled at start (plan state, executor instructions, host events, retry stop, ordered disposal). Plan-task
|
|
109
|
+
verification is cancelled first at disposal, a verdict decided before disposal is still journaled, manual `gc` of a
|
|
110
|
+
completed plan waits for pending phase tags, and `purge` creates no directories, removes the empty plan directory and
|
|
111
|
+
skips collection for an invalid `slotsDir` when the plan holds no slot markers. A `NEED MORE: budget` end resumes
|
|
112
|
+
the same child session as many times as the guard's cumulative call multiplier allows (`BUDGET_RESUMES`), then
|
|
113
|
+
parks as `budget-cap`; each budget resume starts a new guard round for that child across plugin locations (its per-dispatch budget and read
|
|
114
|
+
count restart, the cumulative ceiling stays). A superseded run's late rejection cannot interrupt or unregister its resumed round.
|
|
115
|
+
Plan children keep their resolved tier for both round budgets and cumulative ceilings. An editing task's
|
|
116
|
+
child gets the executor's `CAP:12` read cap (its `[cap: n/12]` and `CAP REACHED` banners, as a routed child's `CAP`)
|
|
117
|
+
and its route's `budget=` as its call budget; interrupted, parked or lost attempts keep
|
|
118
|
+
their uncommitted work on `omr/<plan>/wip/<task>` for the next attempt; WIP refs remain until purge, including after
|
|
119
|
+
abort. Unsaved-slot holds are rebuilt after restarts; gc and purge retry saving before collection. Purge waits up to
|
|
120
|
+
30 seconds for abort cleanup and refuses if it is still pending. Successful clean or presaved releases clear rebuilt
|
|
121
|
+
holds too, preventing duplicate abort releases; retained gc predicates still refuse any remaining hold.
|
|
122
|
+
Metadata-less slot directories are quarantined,
|
|
123
|
+
not counted as clean, and pool gc preserves uncommitted work unless the caller explicitly marks it saved.
|
|
124
|
+
Orchestrator-shell filtering drops only the semicolon-delimited clause marked `(orchestrator shell)`, not its
|
|
125
|
+
neighbours, and compilation warns on mixed criteria lines. A block left with no criteria and no checks falls back to
|
|
126
|
+
the inferred DoD. A cap written in the plan is neutralised with the task's other directives, and shared-context
|
|
127
|
+
directives are neutralised at compile, keeping the stored text identical at launch; editing tasks receive the
|
|
128
|
+
executor's own `CAP:12`, placed first (right after `PLAN CONTEXT`, before the shared context and the task text), so
|
|
129
|
+
it is the first cap token in the child prompt even when a plan token split across lines survives neutralisation.
|
|
130
|
+
Compilation takes the base branch tip from the repository toplevel (detached HEAD is refused) using the
|
|
131
|
+
full branch ref, so a same-named tag cannot confuse it; approval reads the actual plan's ledger rather than deriving
|
|
132
|
+
its id from the slots directory and refuses a moved base with `E_STALE_BASE`. Integration/CI worktrees start from
|
|
133
|
+
the ledger's integration head. Disposal no longer waits on a launch begun after it started: once a plan is disposing,
|
|
134
|
+
the runtime hands the launcher no new child and no budget resume. A park whose slot work could not be saved keeps
|
|
135
|
+
the slot on the parked task (the ledger accepts a slot on a parked task for this), so the slot is never reset or
|
|
136
|
+
released while that work is unsaved. After an abort, slot collection (automatic or `gc`) waits until each cancelled
|
|
137
|
+
child's slot was saved and released, or held when its save failed, so a slot is never collected mid-save.
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
|
|
141
|
+
- **OpenCode v2: the cost doctor separates fresh unknown bindings from stale role resumes.**
|
|
142
|
+
`role-binding-unknown` warns only for fresh children; the new `role-child-stale-resume` info finding reports
|
|
143
|
+
resumed unknown-binding rows over 7 days and this process's refused resumes, without a notice. It suggests
|
|
144
|
+
`routing.orphans.resume: "refuse"` only when set to `"allow"`; role-stats totals are unchanged.
|
|
145
|
+
- **OpenCode v2: stale role-child resumes are refused before a new attempt starts.** An unregistered or retired
|
|
146
|
+
dispatch nonce would leave the child unbound (local actions only, no work root): dispatch a fresh task with the same
|
|
147
|
+
prompt and route line instead. Plan children, live/recovering attempts and other unknown-binding causes are unchanged.
|
|
148
|
+
A lost role-dispatch wake adds `Dispatch a fresh task: resuming it is refused.` only with live roles and resume mode
|
|
149
|
+
`"refuse"`. The refusal covers dispatches lost in a restart or already finished, and names the call's agent.
|
|
150
|
+
- **OpenCode v2: roles protocol teaches slicing for cost within its existing byte budget.** Non-design work is split
|
|
151
|
+
into edit-only implementer dispatches (`class=implement needs=edit d=deterministic` + `testsPass` acceptance), keeping
|
|
152
|
+
the authority floor at most `medium` even at high risk when verification is enabled; a slice that must run commands
|
|
153
|
+
gets a machine check and `VERIFY:required`, avoiding the `heavy` write + exec authority floor when the router gates
|
|
154
|
+
it. Routing is unchanged.
|
|
155
|
+
- **CI: pull requests are Linux-only; one Windows Node 22 typecheck + full-suite coverage job runs on master pushes
|
|
156
|
+
and manual runs.** Linux e2e and Bun smoke stay blocking. Without Windows coverage, only `src/verify/exec.ts`
|
|
157
|
+
and the `src/executor/` prefix are warn-only; with it, all coverage gates block (G-21).
|
|
158
|
+
- **OpenCode v2: register `router_plan` and `/plan` only in roles mode selected at start, like `router_run`.** Tiers
|
|
159
|
+
mode no longer carries the unusable plan-tool schema; switching to roles needs a restart. `/router` help never
|
|
160
|
+
advertises an unregistered or user-defined `/plan`. OpenCode v1's tool, command and help maps are unchanged.
|
|
161
|
+
- **OpenCode v2: shorter serial integration entries.** Integration checks on the slot the queue has just rebased to the
|
|
162
|
+
candidate no longer reset it a second time (clean and HEAD check only, falling back to the full prepare on a HEAD
|
|
163
|
+
mismatch or provisioning drift), and the check-selection reads overlap the clean. Bisect probes, reruns, reverts and
|
|
164
|
+
phase suites keep the full prepare.
|
|
165
|
+
- **CPX e2e smoke: the G8 makespan bound is recorded, not asserted (owner amendment A-6.1-2).** The throughput run
|
|
166
|
+
still reconstructs and records makespan, CP_eff, W_auth/p, ΣI_service, the bound, the ratio and whether it was met;
|
|
167
|
+
service-evidence integrity and the 10,000 ms idle-with-ready ceiling stay asserted. Delegated grading observed as
|
|
168
|
+
`service-unattributed` is recognized verification evidence credited at zero intrinsic cost, so the computed bound is
|
|
169
|
+
conservative.
|
|
170
|
+
- **CPX e2e smoke: amended G8 intrinsic-service oracle (A-6.1-1).** The bound uses the pre-run DAG, authored work,
|
|
171
|
+
attributable verification/integration/phase-suite service and configured parallelism, with fail-closed evidence
|
|
172
|
+
checks and raw CP/integration diagnostics retained. Throughput uses the default integration batching; resilience
|
|
173
|
+
keeps singleton batches.
|
|
174
|
+
- **OpenCode v2: declared plan writers must produce a diff in every verification mode.** The owner's 2026-10-14
|
|
175
|
+
amendment to M39 makes a nonempty write footprint with no changes a counted `commit-failed` (`no changes`) for
|
|
176
|
+
`VERIFY:required`, `deferred` and `none`: bounded retries, then park, never silent `done`. No idempotent exception
|
|
177
|
+
is allowed. Empty-write no-change success and its phase-gate reconciliation are preserved.
|
|
178
|
+
- **OpenCode v2: per-turn router state moves out of the system prompt.** The pending-verification list, late
|
|
179
|
+
verification notices and the route hint are delivered in a per-turn `<router-state>` message appended after the
|
|
180
|
+
conversation, so the system prompt stays byte-stable across turns. Late notices are repeated every turn until
|
|
181
|
+
`router_verify` reads them. OpenCode v1 is unchanged.
|
|
182
|
+
|
|
183
|
+
### Fixed
|
|
184
|
+
|
|
185
|
+
- **OpenCode v2: `/router` lists `/plan` only when `/plan` is registered and the executor can assemble.** That is roles
|
|
186
|
+
mode selected at start and still configured, no user-defined `/plan`, enforced leases, verification not `never` and a location inside
|
|
187
|
+
`routing.workRoots` when configured. Without a routing block, help remains byte-identical to the legacy output;
|
|
188
|
+
OpenCode v1 is unchanged.
|
|
189
|
+
- **OpenCode v2: a task blocked by a reverted dependency keeps its unsaved work.** The integration queue no longer
|
|
190
|
+
gives such a task's slot back to the pool unsaved. The work is first saved at the task's WIP ref (a failed save keeps
|
|
191
|
+
the slot leased). A running task's slot is released once, by the executor, after its cancelled child has ended.
|
|
192
|
+
- **OpenCode v2: recovered plan work keeps interrupted-attempt safety.** Re-provisioning saves an owned slot before
|
|
193
|
+
releasing or resetting it and retains unsaved-work holds on failure. Recovered budget ends wait for root-context
|
|
194
|
+
admission before resuming the same child; launcher-liveness evidence follows the current resume round. Abort drains
|
|
195
|
+
attachment verification before saving/releasing its slots, and collection waits for those pipelines too.
|
|
196
|
+
- **OpenCode v2: executor recovery no longer deadlocks when a task was verifying at restart.** Recovered
|
|
197
|
+
re-verification (and a finished child's completion) no longer blocks the recovery barrier: it waits for the owning
|
|
198
|
+
root's next router call, then runs. An adopt cuts the old attachment's graders, and a cut observation is no longer graded as a counted
|
|
199
|
+
`unverifiable` by the next attachment.
|
|
200
|
+
- **OpenCode v2: plan slots are claimed in launch-priority order.** A slot acquisition took its place in the pool's
|
|
201
|
+
queue only after its own `git rev-parse` returned, so the highest-priority task could claim the last slot and wait
|
|
202
|
+
behind every other slot's provisioning. Claims now queue in call order and await their base lookup inside the claim.
|
|
203
|
+
- **OpenCode v2: after a host restart, the executor requeues a plan child at once when its launching process is
|
|
204
|
+
provably gone.** It records each child's launcher (pid, hostname, per-process token); recovery treats a child as lost
|
|
205
|
+
without the 60 s liveness probation only when that process is dead on this host and the child was not running a tool
|
|
206
|
+
when the host stopped (host contract C16). A child stopped inside a tool, whose processes (for example a `router_run`
|
|
207
|
+
test run) can outlive the host, keeps the probation, as does every other case.
|
|
208
|
+
- **OpenCode v2: diagnostic observations record a scheduler graph row for every committed ledger batch**, including
|
|
209
|
+
metric-only batches, so a runtime row never reports a ledger sequence that no graph row preceded.
|
|
210
|
+
- **OpenCode v2: a plan-task verification that cannot snapshot its slot says why.** The unverifiable result now
|
|
211
|
+
includes a bounded, scrubbed reason (for example a git timeout or a missing file) naming the git stage that failed;
|
|
212
|
+
it still fails closed. A grader that cannot start, and each transient verification rerun, log their reason.
|
|
213
|
+
- **OpenCode v2: integration check selection never treats a failed `git show` as a missing file.** Only git's explicit
|
|
214
|
+
"path does not exist" error means absent; any other read failure fails the check as `prepare`, never a `no-checks`
|
|
215
|
+
pass. A failed prepare now waits for its overlapped reads before the slot is retried.
|
|
216
|
+
- **OpenCode v2: integration-check pytest uses the slot's virtual environment again.** Since the guarded-executable
|
|
217
|
+
change, pytest checks ran the host interpreter without the slot's environment. They again run the slot's provisioned
|
|
218
|
+
`.venv` interpreter with `VIRTUAL_ENV` set, the virtual environment first on `PATH` and `PYTHONPATH`/`PYTHONHOME`
|
|
219
|
+
unset, as `router_run` does; credentials stay stripped and `ComSpec` is the validated system shell on Windows. The
|
|
220
|
+
`.venv` interpreter is accepted only when it matches the slot's post-provisioning snapshot (path, size and
|
|
221
|
+
modification time), the same trust rule as `router_run`. Otherwise the absolute host interpreter outside the slot runs.
|
|
222
|
+
A file planted in the slot root is never selected. As in `router_run`, a slot without a detected Python manager gets
|
|
223
|
+
no virtual environment (and unsets `PYTHONPATH`, `PYTHONHOME` and `VIRTUAL_ENV`); only outside a registered slot do
|
|
224
|
+
the host's values pass through. The interpreter is resolved again from the configuration for every slot a command
|
|
225
|
+
runs in, never reused from another slot.
|
|
226
|
+
- **OpenCode v2: QA fix tasks get a launchable route line for any repository path.** A repository or phase root that
|
|
227
|
+
cannot be written safely into a route line (brackets, quotes, separators) is omitted, since the slot root is always
|
|
228
|
+
appended at launch; fix tasks stored by the earlier build with an unbracketed line launch as well.
|
|
229
|
+
- **OpenCode v2: the executor's default QA fix task route line is now a well-formed `[route ...]` line**, so a fix task created at runtime without a phase `FIX` template launches instead of failing route rendering.
|
|
230
|
+
- **OpenCode v2: service observations exclude process preparation, mark native grading without provider-attempt events as insufficient evidence, and attribute plan-task checks and grading to the checked candidate.**
|
|
231
|
+
- **OpenCode v2: the executor admits tasks to physical slots in critical-path priority order.** A lower-priority
|
|
232
|
+
task no longer takes the only free slot ahead of a higher-priority ready task, and a durable slot release reschedules
|
|
233
|
+
slot-blocked tasks at once instead of waiting for their retry backoff.
|
|
234
|
+
- **OpenCode v2: reused executor slots no longer launch dirty or at the wrong base after dependency provisioning.** An
|
|
235
|
+
acquisition whose reset ran an installer afterwards gives no reset proof, so the launch resets the slot again.
|
|
236
|
+
- **OpenCode v2: executor children adopted after a launch-confirmation timeout get their timing row**, exactly once,
|
|
237
|
+
without reviving the launch's settled completion effects.
|
|
238
|
+
- **OpenCode v2: executor launches reuse acquisition's verified reset at the current integration head, avoiding a duplicate reset while retaining full preparation for moved heads and unproven leases.**
|
|
239
|
+
- **OpenCode v2: the executor's idle-with-ready metric reports a duration exactly equal to its endpoints.**
|
|
240
|
+
- **CPX e2e G8 idle checks reconstruct maximal episodes from committed v2 observations.** Failed slot/launch
|
|
241
|
+
reservations no longer hide stalls by fragmenting ledger metrics. The unchanged 10,000 ms ceiling applies to
|
|
242
|
+
whole episodes; every ledger fragment must be covered, and missing seals, sequence gaps or dropped events fail
|
|
243
|
+
closed. The asserted G8 idle predicate, confirmed by the owner on 2026-10-14, is **A: durable ready work with
|
|
244
|
+
provider capacity**, so time spent waiting for a physical slot counts as idle. The physical-slot-blocked/launchable
|
|
245
|
+
split (predicate B) is diagnostic only and cannot shorten an asserted episode; the 10,000 ms bound has not been
|
|
246
|
+
relaxed. Per-host streams are retained before scratch cleanup, including incomplete failure/restart diagnostics.
|
|
247
|
+
- **CPX e2e smoke throughput checks follow the strict G8 contract:** provider delays and the independent CP/W
|
|
248
|
+
oracle use authored fixture milliseconds, makespan has no additive slack, and idle with ready work is capped at
|
|
249
|
+
10,000 ms. By owner amendment (2026-10-14) the fixed 90 s per-host watchdog, which cannot hold a complete run
|
|
250
|
+
(measured serial integration alone is ~75–85 s), is replaced by one derived from the contract: a 60 s setup
|
|
251
|
+
watchdog, then 1.3 × max(CP, W/p, entries × 5 s) plus a 60 s audit margin, capped at 300 s per host. The
|
|
252
|
+
per-entry allowance only sizes the watchdog; the G8 assertion keeps the measured serial integration.
|
|
253
|
+
- **OpenCode v2: malformed shared lease registry entries no longer disable enforcement.** Entries are validated
|
|
254
|
+
individually; an invalid entry is refused without replacing it or disturbing valid registries. If the registry cannot
|
|
255
|
+
start with leases enforced, lease-checked file, search, git and run tools are refused instead of bypassing enforcement.
|
|
256
|
+
- **OpenCode v2: plan checks re-resolve inherited router commands for the prepared execution slot.** Phase suites,
|
|
257
|
+
base checks, bisect probes and revert regressions refresh the command executable, environment and authorization
|
|
258
|
+
against the checkout under test rather than reusing the integration worktree's resolution. Explicit working-directory
|
|
259
|
+
and environment overrides are preserved. Configured commands and commands with explicit `cwd` or `env` overrides
|
|
260
|
+
execute unchanged in full instead of being replaced by scoped runs; ordinary equivalent package-script test scoping
|
|
261
|
+
is retained.
|
|
262
|
+
- **OpenCode v2: plan phase bisects distinguish actual file-scoped checks from full-command fallbacks.** A full or
|
|
263
|
+
mixed run cannot establish isolated-file evidence. With a failing base and no valid isolation, a regression remains
|
|
264
|
+
unattributed instead of blaming the wrong task; a file-scoped bisect also stops unattributed if a historical probe
|
|
265
|
+
falls back to full commands. Genuine file-scoped bisects are preserved.
|
|
266
|
+
- **OpenCode v2: explicit plan-writer routes are checked against the selected role's edit grant.** Compilation uses
|
|
267
|
+
the resolved role policy, including configured permission narrowing, rather than class/tier heuristics. A writer
|
|
268
|
+
routed to a general role without an `edit` grant is rejected with a task and line diagnostic; valid edit-capable routes
|
|
269
|
+
remain accepted.
|
|
270
|
+
- **OpenCode v2: failed rebase cleanup preserves the initiating Git error.** Cleanup checks the slot's rebase state
|
|
271
|
+
before aborting and retains the original failure alongside any cleanup error. Integration refusals persist bounded
|
|
272
|
+
diagnostic details in the journal with URL credentials redacted from keys and string values before clipping, with
|
|
273
|
+
bounded traversal and output handling.
|
|
274
|
+
- **OpenCode v2: inferred plan writers no longer launch as read-only explorers.** Before role selection, explicit
|
|
275
|
+
or ownership-inferred write footprints reconcile automatically inferred read-only classes and add the `edit` need,
|
|
276
|
+
keeping the tier, pin, risk and existing needs. Incompatible authored read-only routes fail compilation with a task
|
|
277
|
+
and line diagnostic instead of being silently overridden. Manual/preflight/QA tasks and `Writes: none` are excluded;
|
|
278
|
+
explorer permissions are unchanged.
|
|
279
|
+
- **OpenCode v2: plan phase suites and base checks run in the CI slot at the commit under test, not the integration worktree's current head.**
|
|
280
|
+
- **OpenCode v2: plan phases no longer stall after a no-change completion.** Tasks that finish without a commit and
|
|
281
|
+
manual/preflight tasks reported done reconcile their phase gates and dependent phases, so QA launches without another
|
|
282
|
+
orchestrator turn.
|
|
283
|
+
- **OpenCode v2: work leases no longer collide across linked worktrees.** Two child sessions that edit the same
|
|
284
|
+
repo-relative path in two worktrees of one repository (`git worktree add`) are both allowed: an ordinary write lease
|
|
285
|
+
is keyed by its checkout, not by the repository, and a write whose target the router cannot read is refused only while
|
|
286
|
+
another child holds a lease in the same checkout. The leases of plan tasks stay repository-wide among plan tasks, so
|
|
287
|
+
two plan tasks that edit one path in two slots still refuse each other, and a plan child's write whose target the
|
|
288
|
+
router cannot read is checked against the plan-task leases in the whole repository. A path spelling that may name
|
|
289
|
+
any file (a device path, an 8.3 short name, a drive-relative path) still fails closed against every holder anywhere.
|
|
290
|
+
A refusal names the file under edit and asks for the requester's own path in `NEED MORE: lease` (repo-relative for a
|
|
291
|
+
plan task). Reads were already keyed by the file on disk. OpenCode v1 is unchanged.
|
|
292
|
+
- **OpenCode v2: plugin module copies share one process-wide lease registry.** Snapshot restoration is attempted only
|
|
293
|
+
once when the registry is created, even if the snapshot is missing or invalid, so a later location cannot overwrite
|
|
294
|
+
live leases by restoring again.
|
|
295
|
+
- **OpenCode v2: a resumed background dispatch delivers its own answer.** It no longer takes an earlier turn's
|
|
296
|
+
completion as its own result, even when the earlier turn was still being processed when the parent saw it, nor the
|
|
297
|
+
child's earlier answer. Completions are told apart by the message that carries them rather than by their text, so two
|
|
298
|
+
turns with the same answer each get one verdict; a dispatch whose child ended before its answer could be read is
|
|
299
|
+
read again on the parent's next request instead of waiting for the 6 h sweep. Known limit: the set of completions
|
|
300
|
+
already taken lives in memory, so a resume right after a plugin restart can still mis-attribute.
|
|
301
|
+
- **OpenCode v2: background dispatches without a deterministic check are graded.** Their grader launches as the
|
|
302
|
+
orchestrator agent that made the call, also after a restart, never from a role child's context (which denies
|
|
303
|
+
`subagent`); an entry journaled by an older build falls back to the parent session's current agent and its latest
|
|
304
|
+
assistant message (looked up for at most 2 s, and not for a completion that did not succeed), and a result that
|
|
305
|
+
could not be verified is tagged `UNVERIFIABLE` instead of `PASS`. Acceptance is unchanged. OpenCode v1 is unchanged.
|
|
306
|
+
- **OpenCode v2: one plugin copy per process decides each background call.** Call claims are process-wide across the
|
|
307
|
+
plugin copies a host loads per location (bounded to 8000 claims in all, the oldest of any copy evicted first): a
|
|
308
|
+
call that reaches several copies is completed once, and the claiming copy's background decision stands. A copy that
|
|
309
|
+
lost the claim leaves the call's `background` flag as it found it and does not tell the orchestrator the result is
|
|
310
|
+
unverified. OpenCode v1 is unchanged.
|
|
311
|
+
- **OpenCode v2: an unrecorded child session never backgrounds a dispatch.** A child the plugin never recorded (after a
|
|
312
|
+
reload, or past the 1000-entry bound) no longer counts as a root parent in the background decision (root parents
|
|
313
|
+
only): its kind comes from the role decision's session read or from the host, and a failed lookup keeps the
|
|
314
|
+
foreground value. OpenCode v1 is unchanged.
|
|
315
|
+
- **OpenCode v2: background-first runs write `turns.jsonl` rows.** The end of a root session's run now closes its
|
|
316
|
+
orchestrator turn, so the kickoff and each wake-up (runs that no user prompt starts) get one row each, even while a
|
|
317
|
+
background dispatch is still open. OpenCode v1 is unchanged.
|
|
318
|
+
- **Role prompts: the dispatch's work root wins over the host's environment block.** The work-root rule of every role
|
|
319
|
+
prompt now says that the router's `Working directory:` line and the work root in the dispatch's ENVIRONMENT win over
|
|
320
|
+
the working directory in the host's environment block (role children get the task without the route line), so a role
|
|
321
|
+
no longer refuses its work root because the host named the parent's directory.
|
|
322
|
+
- **OpenCode v2: a second booted location no longer settles another location's running dispatch as `lost in
|
|
323
|
+
restart`.** When one host process loads a router instance per location, each instance now keeps a beat file in
|
|
324
|
+
`pending.instances` next to `pending.claims` while it holds a session claim. A new instance refuses to adopt a
|
|
325
|
+
session whose claim belongs to a live sibling instance, so that instance's records stay dormant and its verdict is
|
|
326
|
+
the only one delivered. A dead owner (stale beat, or dead pid) is still recovered as before. Journal and claim
|
|
327
|
+
records written by earlier builds read as before. OpenCode v1 is unchanged.
|
|
328
|
+
- **OpenCode v2: no start-up reference GC in a location outside `routing.workRoots`.** When `routing.workRoots` is
|
|
329
|
+
configured and non-empty, an instance loaded in a directory outside every entry skips the start-up reference GC and
|
|
330
|
+
logs one info line naming the skip. Role agent registration in roles mode still lists the repository's worktrees
|
|
331
|
+
there (`git worktree list`, read-only), so a `routing.workRoots` glob meant for later-created worktrees does not drop
|
|
332
|
+
the existing ones from the role agents' `external_directory` rules. With executor enforcement enabled, role agents
|
|
333
|
+
still deny the executor home there when worktrees were listed or their listing failed, and get no executor slots-root
|
|
334
|
+
allowance. The location check uses the documented
|
|
335
|
+
glob semantics (`*` crosses separators, as in the role agents' rules) and compares canonical paths. Without
|
|
336
|
+
`routing.workRoots` nothing changes. OpenCode v1 is unchanged.
|
|
337
|
+
- **OpenCode v2: `router_verify` on a held background handle reports the verdict its gate reached** (method, outcome,
|
|
338
|
+
reasons, caveats and notes). It used to settle every held gate verdict as a deterministic result with no caveats, so
|
|
339
|
+
a checker that could not verify showed "UNVERIFIED: deterministic" without the grader's reason and a pass with
|
|
340
|
+
caveats showed "✓ verified". The stored pass/outcome always match the posted tag (a trivial dispatch the gate accepts
|
|
341
|
+
unverified reads pass, a pass that `strictUnverifiable` rejects reads fail, also when re-posted after a restart). The
|
|
342
|
+
posted verdict is unchanged. OpenCode v1 is unchanged.
|
|
343
|
+
- **OpenCode v2: plugin copies loaded per booted location share the pending journal safely.** A fresh writer mark of
|
|
344
|
+
the same process under another module token counts as a live writer (start-up compaction is skipped), each copy
|
|
345
|
+
compacts through its own temp file, and a recreate merges the records of every copy. Beat files in
|
|
346
|
+
`pending.instances` are written atomically, a half-written beat counts as live while its modification time is
|
|
347
|
+
fresh, and stale beats are swept at start. When the host evicts a location while its child still runs, the adopting
|
|
348
|
+
instance keeps that dispatch dormant until its end event instead of reporting it `lost in restart`.
|
|
349
|
+
- **OpenCode v2: the background decision's parent lookup is bounded.** An unrecorded parent is looked up at most once
|
|
350
|
+
and for at most 1 s; on timeout the dispatch stays in the foreground.
|
|
351
|
+
- **OpenCode v2: plugin copies loaded per host location share one timing recorder.** When one host process loads the
|
|
352
|
+
plugin once per location, `turns.jsonl` no longer gets repeated rows and its turn numbers no longer restart, and the
|
|
353
|
+
`/router stats` orchestrator cache-read share is no longer over-counted. The recorder is shared per directory across
|
|
354
|
+
the copies of one build; a recorder registered by a build with another registry version is left alone. OpenCode v1 is
|
|
355
|
+
unchanged.
|
|
356
|
+
- **Plan executor: a child adopted after a restart no longer writes into a released slot.** When its task is blocked by
|
|
357
|
+
a reverted dependency or the plan is aborted, the child is interrupted and awaited before its slot is saved and
|
|
358
|
+
released. If it cannot be stopped, the slot stays held with one blocking inbox item.
|
|
359
|
+
|
|
360
|
+
### Security
|
|
361
|
+
|
|
362
|
+
- **OpenCode v2: executor check discovery uses absolute, guarded executables.** Git searches use hardened arguments
|
|
363
|
+
and environment; pytest resolves its interpreter outside guarded checkouts, or takes the slot's provisioned
|
|
364
|
+
virtual-environment interpreter as `router_run` does. Both use a credential-stripped run
|
|
365
|
+
environment with explicit full-environment replacement and Windows current-directory search protection, so process
|
|
366
|
+
inheritance cannot restore provider credentials. Other process callers retain their default environment merging.
|
|
367
|
+
- **OpenCode v2 (v1 unchanged): an unbound plan child is refused every tool call.** A child session whose first message
|
|
368
|
+
is a plan launcher prompt (`PLAN CONTEXT` followed by the launch header at its grammar position) but that has no
|
|
369
|
+
matching plan binding is refused every tool call (fail closed). The prompt is recognized at the start of the message
|
|
370
|
+
or right after the one preamble line the host puts before a subagent's first message ("You are a subagent spawned by
|
|
371
|
+
another session."); any other leading text makes it an ordinary prompt. Parallel tool calls of such a session all
|
|
372
|
+
wait for the same check, and an ordinary prompt is never refused, even when the session's kind cannot be looked up.
|
|
373
|
+
|
|
10
374
|
## [2.8.0] - 2026-10-13
|
|
11
375
|
|
|
12
376
|
### Added
|
package/README.md
CHANGED
|
@@ -1232,6 +1232,26 @@ With `routing.delegation: "roles"` the orchestrator stops picking tiers: it disp
|
|
|
1232
1232
|
|
|
1233
1233
|
Put `{ "routing": { "delegation": "roles" } }` in the global override file and **restart OpenCode** (roles mode is decided at plugin start); restore the previous file and restart to go back. OpenCode v1 keeps the tier model. Guide: [`docs/ROLES.md`](docs/ROLES.md); decision record: [`docs/adr/0006-role-tier-assurance-delegation.md`](docs/adr/0006-role-tier-assurance-delegation.md).
|
|
1234
1234
|
|
|
1235
|
+
## Executing plans
|
|
1236
|
+
|
|
1237
|
+
On **OpenCode v2 in roles mode selected at start**, `/plan run <path>` asks the orchestrator to compile a Markdown plan into a durable task ledger and
|
|
1238
|
+
dependency graph through `router_plan`. It shows the task count, critical path, expected makespan and manual tasks.
|
|
1239
|
+
With the default `routing.executor.approve: "ask"`, compilation **does not start work**: review the summary, then use
|
|
1240
|
+
`/plan approve <planId>` or explicitly approve that plan after seeing its summary. A request to run it is not approval;
|
|
1241
|
+
the model never approves on its own. Global `approve: "auto"` is an explicit opt-in.
|
|
1242
|
+
|
|
1243
|
+
Ready tasks run in parallel in isolated git worktree slots, are verified there, then integrate serially through checks.
|
|
1244
|
+
`/plan status [planId]` shows progress, inbox and metrics; `/plan inbox` lists decisions and `/plan answer <id> <text>`
|
|
1245
|
+
answers one. Use `/plan pause <planId>` to stop new launches, `/plan resume <planId>` to continue, and `/plan land <planId>`
|
|
1246
|
+
to request fast-forward landing into a clean checkout. The ledger survives a restart; it is not conversation state.
|
|
1247
|
+
|
|
1248
|
+
The executor requires roles mode selected at start, enforced leases, a git repository and an available plan-task
|
|
1249
|
+
verifier (`enforcement.verify.require` must not be `"never"`). OpenCode v1 registers no executor tool or command.
|
|
1250
|
+
`router_plan` and `/plan` are registered only in roles mode at start, like `router_run`; tiers mode registers neither.
|
|
1251
|
+
See [the executor guide](docs/EXECUTOR.md) for setup, every command/action/config key, the safety model, Windows notes,
|
|
1252
|
+
recovery, troubleshooting, metrics and the owner checklist; [ADR 0007](docs/adr/0007-critical-path-execution.md) records
|
|
1253
|
+
the decisions. `/annotate-plan` below only annotates a plan; it does not execute it.
|
|
1254
|
+
|
|
1235
1255
|
## TUI status (OpenCode v2)
|
|
1236
1256
|
|
|
1237
1257
|
On OpenCode v2 (2.0.24 or later) the package also ships a TUI entry, `tui.ts`, that shows which model and effort the router's sessions run with:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-model-router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "OpenCode plugin that routes tasks to tiered subagents (fast/medium/heavy) based on complexity",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
"smoke:routing": "cross-env RUN_OC_SMOKE_ROUTING=1 vitest run --config vitest.smoke.config.ts test/smoke/routing-engine.smoke.test.ts",
|
|
16
16
|
"smoke:v2:e2e": "cross-env RUN_OC_SMOKE_V2_E2E=1 vitest run --config vitest.smoke.config.ts test/smoke/v2-provider-e2e.smoke.test.ts",
|
|
17
17
|
"smoke:tui": "cross-env RUN_OC_SMOKE_TUI=1 vitest run --config vitest.smoke.config.ts test/smoke/tui-status.smoke.test.ts",
|
|
18
|
+
"smoke:cpx": "cross-env RUN_OC_SMOKE_CPX=1 vitest run --config vitest.smoke.config.ts test/smoke/helpers/cpx-scripted-provider test/smoke/helpers/routing-host test/smoke/cpx-host-contract test/smoke/cpx-cache-prefix test/smoke/cpx-background",
|
|
19
|
+
"smoke:cpx:provision": "cross-env RUN_OC_SMOKE_CPX=1 vitest run --config vitest.smoke.config.ts test/smoke/cpx-provision",
|
|
20
|
+
"smoke:cpx:e2e": "cross-env RUN_OC_SMOKE_CPX=1 vitest run --config vitest.smoke.config.ts test/smoke/cpx-e2e",
|
|
18
21
|
"routing:stats": "node scripts/routing-stats.ts",
|
|
22
|
+
"soak:analyze": "node scripts/soak-analyze.mjs",
|
|
19
23
|
"typecheck": "tsc --noEmit"
|
|
20
24
|
},
|
|
21
25
|
"license": "GPL-3.0-only",
|
package/src/commands/output.ts
CHANGED
|
@@ -239,7 +239,10 @@ export const ROUTER_APPROVAL_HELP_LINES: readonly string[] = Object.freeze([
|
|
|
239
239
|
]);
|
|
240
240
|
|
|
241
241
|
/** Bare `/router`. */
|
|
242
|
-
export function buildRouterHelp(
|
|
242
|
+
export function buildRouterHelp(
|
|
243
|
+
current: string,
|
|
244
|
+
options: { stats?: boolean; roles?: Iterable<RoleSpec>; approvals?: boolean; plan?: boolean } = {},
|
|
245
|
+
): string {
|
|
243
246
|
const roleLines = options.roles === undefined ? [] : buildRoleLines(options.roles);
|
|
244
247
|
return [
|
|
245
248
|
`# Model Router`,
|
|
@@ -254,10 +257,29 @@ export function buildRouterHelp(current: string, options: { stats?: boolean; rol
|
|
|
254
257
|
: []),
|
|
255
258
|
...(options.approvals === true ? ROUTER_APPROVAL_HELP_LINES : []),
|
|
256
259
|
"- `/tiers`, `/preset`, `/budget`, `/bypass`, `/annotate-plan`",
|
|
260
|
+
...(options.plan === true ? ["", ...PLAN_HELP_LINES] : []),
|
|
257
261
|
...(roleLines.length > 0 ? ["", ...roleLines] : []),
|
|
258
262
|
].join("\n");
|
|
259
263
|
}
|
|
260
264
|
|
|
265
|
+
/** `/plan` usage lines (v2 only): appended to `/router` help when `plan` is set and printed for an unknown `/plan` subcommand. */
|
|
266
|
+
export const PLAN_HELP_LINES: readonly string[] = [
|
|
267
|
+
"Plan executor (`/plan`):",
|
|
268
|
+
"- `/plan run <path> [--phases <id,id,...>] [--done-before <id>]` — compile a plan file (path absolute, or relative to the project directory) and show its summary; it does not start until approved",
|
|
269
|
+
"- `/plan approve <planId>` — approve a compiled plan and start it (not needed with `executor.approve: \"auto\"`)",
|
|
270
|
+
"- `/plan status [planId]` — show plan progress",
|
|
271
|
+
"- `/plan inbox [--plan <planId>]` — show the questions waiting for an answer",
|
|
272
|
+
"- `/plan answer [--plan <planId>] <id> <text>` — answer an inbox question (without `--plan`: this session's running plan)",
|
|
273
|
+
"- `/plan pause|resume|abort <planId>` — pause, resume or abort a plan",
|
|
274
|
+
"- `/plan land <planId>` — land a finished plan",
|
|
275
|
+
"- `/plan adopt <planId>` — adopt a plan whose owning session is gone",
|
|
276
|
+
];
|
|
277
|
+
|
|
278
|
+
/** `/plan` with no or an unknown subcommand. */
|
|
279
|
+
export function buildPlanHelp(): string {
|
|
280
|
+
return ["# Plan executor", "", ...PLAN_HELP_LINES].join("\n");
|
|
281
|
+
}
|
|
282
|
+
|
|
261
283
|
/**
|
|
262
284
|
* `/router models [provider]`. Takes the catalog the caller fetched, so a
|
|
263
285
|
* failed or unavailable fetch is a null here rather than an exception path.
|