Repository navigation
Commit d2f924a
committed
fix(workspace): arm the abort through the body, read config before the status gate, cancel the losing timer
Codex round 12. Three findings, all verified, all follow-ups on last round's fixes.
**The abort now stays armed until the response body is read.** fetch resolves on
headers, so clearing the timer there left a server that sends headers and then
stalls mid-body hanging indefinitely, holding its socket. The bound added last
round covered the wrong half of the request.
Two sibling functions in the same client share this shape. They are pre-existing
and untouched here rather than swept in silently; noted for a follow-up.
**Config is read before the MCP status gate, not after.** MCP.status() reads the
same cached config as everything else, so an entry added directly by an IDE or a
user after the cache was warmed is absent from status. The entry check then never
ran and the managed entry was persisted straight over the externally authored
one. Reading the entry first is what refreshes that cache, so the status gate
becomes trustworthy rather than merely fresh-looking.
That is the fourth route by which this cache has produced a wrong answer, and the
first where the stale read was inside MCP rather than here — the freshConfig
accessor fixed this module's own reads but could not fix a gate that consults the
cache independently.
**The losing allowlist timer is cancelled.** Racing does not cancel the loser, so
a lookup that succeeded in well under the bound still fired its timeout later and
warned that it had timed out — on every normal attach and reuse. A fix whose only
symptom was misleading logs, which is the kind that survives longest.
1 test pinning the ordering: the config read must precede the status gate, and it
fails with the two swapped. The timer cancellation is verified by inspection —
its only observable effect is a log line, and manufacturing a seam to assert on a
log would be worse than the bug.1 parent 4e3e28a commit d2f924a
3 files changed
Lines changed: 74 additions & 27 deletions
File tree
- packages/opencode
- src/altimate
- api
- workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
253 | 261 | | |
254 | | - | |
255 | 262 | | |
256 | 263 | | |
257 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
| |||
566 | 573 | | |
567 | 574 | | |
568 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
569 | 582 | | |
570 | 583 | | |
571 | 584 | | |
572 | | - | |
573 | 585 | | |
574 | 586 | | |
575 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
0 commit comments