Repository navigation
Commit a7f9c85
authored
feat: add OpenCode adapter and V2 orchestration support (#49)
This adds `entrust:opencode` as an external worker adapter backed by one
shared OpenCode server and independent worker sessions. It carries model
selection, continuation, typed questions/permissions, Stop, reports, and
explicit V2 selection into orchestration.
## Changes
- Add the OpenCode skill, host wrapper, V1 compatibility client, and
explicit native V2 client/driver.
- Add typed immutable callback handling, session ownership, native
profile verification, durable attribution, and bounded pagination.
- Allow orchestrate plans and swarm batches to select `opencode`;
preserve Codex as the existing default.
- Default discovery to the first two recent models in saved order; pin
the selected model for registered plans and continuation.
- Document measured transport behavior, restoration, and unsupported
capabilities.
## Validation
- OpenCode adapter suite: 65/65 passed after the final native contract
correction.
- Real V2 launcher gate: question, permission-controlled `printf`,
wrapper Stop during a running tool, then same-session continuation; each
completed invocation had a valid schema receipt. Six admissions across
retained attempts took 254.016 seconds; the original singleton was
restored.
- `git diff --check` passed. The broader suite was 22/23 green before
the final native contract correction; `orchestrate-live` was not run.
## Active steer limitation
Steer itself is available at a safe provider-turn boundary, and the live
probe observed that behavior. The strict guarantee we need for Codex
parity is missing: the pinned V2 prompt schema accepts `delivery:
"steer"` but has no expected active turn/generation ID. A client-side
GET followed by POST cannot atomically ensure the same invocation is
still active at admission; another prompt, client, or state transition
can race between them. This is a delivery-fencing gap, not a consequence
of `/wait` returning 503. See the [pinned V2 session
schema](https://github.com/anomalyco/opencode/blob/aec0b9a6d8898f68f923aaf08b7306d931fd9d76/packages/protocol/src/groups/session.ts)
and the open [upstream request for distinct queue/steer/break
semantics](anomalyco/opencode#32157).
Options:
1. **Preferred for strict parity:** add an upstream
expected-turn/generation token, validate it atomically with prompt
admission, return a stale-target conflict, and expose the accepted
target in durable events. Add race tests for simultaneous prompts, tool
boundaries, Stop, and turn completion.
2. **Best effort:** keep next-boundary steer and state that it may land
after the observed turn changes. Polling narrows the race window but
does not close it.
3. **Queue:** submit a separate next task. This preserves order but does
not guide the active task.
4. **Stop and reissue:** use break/abort followed by a new prompt. This
is cancellation with possible partial side effects or unknown outcome,
not steer.
This PR implements explicit V2 boundary delivery and reports the strict
steer gap. It does not claim full interaction parity or change the
server's global/default API family.1 parent 58bd0b0 commit a7f9c85
24 files changed
Lines changed: 3591 additions & 28 deletions
File tree
- .claude-plugin
- plugins/entrust
- evals
- plugin
- .claude-plugin
- agents
- skills
- codex/scripts
- opencode
- references
- scripts
- orchestrate
- swarm
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments