Repository navigation
Commit a00ac46
committed
feat(car): surface failures, honour tool idempotency, add recall and preflight
Covers the correctness and observability gaps found in the CAR integration audit.
Stop degrading silently (anomalyco#8). Every CAR call falls back rather than failing the
turn, which is right — CAR is an augmentation — but the fallbacks were silent:
addFact and ingestSkill were piped through Effect.ignore, and buildContext,
findSkill, listSkills and factCount swallowed errors into empty values. That is
exactly how the memory-sandbox breakage went unnoticed for a whole session, with
persistMemory failing on every teardown and nothing saying so. All degradations
now log and are counted in a per-instance health tally reported by
`opencode debug car`. ingestSkill also no longer marks a skill as ingested when
the call failed, which would have masked it permanently for that instance.
Honour tool idempotency (anomalyco#9). The proposal hardcoded idempotent:false even though
registerToolSchema already carried the tool's real hint, so CAR could never
dedupe an idempotent tool. max_retries stays 0 deliberately: a CAR-side retry
re-invokes our dispatcher and re-runs the tool for real, so raising it needs
CAR's retry semantics verified first (car-releases#76).
Weight facts by how they were obtained (anomalyco#9). addFact now passes CAR's confidence
argument, which was never supplied. Things observed directly — the user's own
words, a tool's actual result or failure — are ground truth; model-generated
prose is an assertion and should not outweigh them.
Add real recall (anomalyco#10). Memory was write-only: addFact fired constantly but
queryFacts was never called and the only read path was buildContext's opaque
blob. The service now exposes graph-spreading-activation recall, available as
`opencode debug car --recall <text>`.
Harden the runner (anomalyco#11). Registration retries with exponential backoff, a
dropped socket clears the memoized connection so the next call re-registers
rather than hanging on a dead runner, in-flight calls are failed instead of
being left to hang, and the host's abort signal now cancels the delegated call —
which matters most during the ~5s pre-dispatch window (car-releases#75).
Add daemon preflight (anomalyco#12). `opencode debug car` reports reachability, client
vs daemon version skew, and whether the running daemon actually knows the
delegated model — the three things that otherwise only surface as a confusing
mid-inference failure. Note models.list omits delegated models entirely; only
models.list_unified reports them, so the obvious check reports a false negative.
Full suite with CAR off: 3232 pass, 0 fail — identical to pristine upstream/dev.1 parent 88ebc3f commit a00ac46
6 files changed
Lines changed: 334 additions & 80 deletions
File tree
- packages/opencode/src
- car
- cli/cmd/debug
- session
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
133 | 247 | | |
134 | 248 | | |
135 | 249 | | |
| |||
0 commit comments