Repository navigation
Commit 12a04fa
feat(opencode): wire registerToolSchema with feature detection
CAR upstream issue anomalyco#20 (Parslee-ai/car-releases#20)
was fixed at car/673fd07 — registerToolSchema(schemaJson) on the
runtime takes a serialized ToolSchema, and car-validator runs
full JSON Schema validation in verifyProposal when populated.
The fix is awaiting an npm release; opencode adds the wiring now
behind a typeof check so:
- on car-runtime 0.5.1 (current published): typeof check is
false, fall through to schemaless registerTool — identical
behavior to before
- on a future release that exposes registerToolSchema: opencode
passes the JSON Schema (built via EffectZod.toJsonSchema for
built-in tools, MCP-provided inputSchema for MCP tools), and
CAR validates parameter shape during pre-flight verify
README "Coming next" updated. Declarative permission policies
removed from the list — CAR maintainer closed the per-session
scoping issue (anomalyco#19) recommending per-runtime isolation, but
opencode keeps the per-instance model for cross-session memory
continuity, so permissions stay inline via ctx.ask.
122/123 session tests pass; the single failure is a pre-existing
flaky timing test (cancel finalizes interrupted bash tool output)
that fails ~2/3 of runs on the parent commit too — not introduced
here.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 4d49c5d commit 12a04fa
2 files changed
Lines changed: 44 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| |||
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
131 | | - | |
| 138 | + | |
132 | 139 | | |
133 | 140 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
138 | 161 | | |
139 | 162 | | |
140 | 163 | | |
141 | 164 | | |
142 | 165 | | |
143 | | - | |
| 166 | + | |
144 | 167 | | |
145 | 168 | | |
146 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
438 | 443 | | |
439 | 444 | | |
440 | 445 | | |
| |||
480 | 485 | | |
481 | 486 | | |
482 | 487 | | |
483 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
484 | 497 | | |
485 | 498 | | |
486 | 499 | | |
| |||
0 commit comments