Repository navigation
Commit 4e3e28a
committed
fix(workspace): bound the catalog lookup on both paths, and stop overstating the late-attach fallback
Codex round 11. Two findings, both verified.
**The allowlist bound covered only one of two call sites.** Last round bounded
the fresh-spawn path and left a reused engine awaiting the same lookup with no
limit — a partial fix that read as a complete one. Both paths now go through a
single bounded helper, so there is one answer rather than two.
The underlying request was genuinely unbounded, not merely slow: the generic
API request performed a bare fetch with no abort signal, while two other
functions in that same client already attach one. It does now, so a stalled
server releases its socket instead of accumulating pending fetches across repair
retries — which a Promise.race alone cannot do, since racing a promise does not
cancel what it is racing.
**Publishing a tool-change event does not refresh the running turn, and this
module said otherwise.** The invocation's tool set is passed to the model before
a late attach completes and cannot be rebuilt mid-call; the session's subscriber
only logs, and the next resolveTools is what picks the tools up. So exceeding the
bounded wait costs a turn, not a session.
That is a correction to a claim this branch has repeated since the wait was
introduced. Publishing the event remains right — nothing downstream could
otherwise observe a late attach at all — but it is traceability and a hook for
subscribers that act between turns, not a live refresh, and the comment now says
so rather than promising delivery it cannot make.
1 test: a stalled catalog lookup no longer blocks the reuse path, and reuse still
succeeds with only the optional reporting degraded. It fails with the reuse-path
bound reverted.1 parent fee2a0c commit 4e3e28a
3 files changed
Lines changed: 63 additions & 20 deletions
File tree
- packages/opencode
- src/altimate
- api
- workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
235 | 241 | | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
243 | | - | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
408 | 413 | | |
409 | 414 | | |
410 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
411 | 441 | | |
412 | 442 | | |
413 | 443 | | |
| |||
638 | 668 | | |
639 | 669 | | |
640 | 670 | | |
641 | | - | |
| 671 | + | |
642 | 672 | | |
643 | 673 | | |
644 | 674 | | |
| |||
696 | 726 | | |
697 | 727 | | |
698 | 728 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 729 | + | |
712 | 730 | | |
713 | 731 | | |
714 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
0 commit comments