Commit bf1d500
authored
claude --output-format json buffers its whole response, so ANY run exceeding its effort
timeout has produced zero stdout when the deadline lands -- which trips the first-output
watchdog and throws claude_stalled_no_output rather than subscription_cli_timeout. The
retry-break tested for the latter by strict string equality, so it never matched: every
timed-out review burned all three attempts (3x180s at default effort, 3x600s at the top tier)
before the fallback model was tried at all. With QUEUE_CONCURRENCY defaulting to 8 that parks
the whole queue during a provider slowdown, and the per-provider circuit breaker needs three
FULL-LENGTH failures before it trips. Matched by prefix, since these errors carry a detail
suffix -- the strict equality is the original bug. subscription_cli_timeout was effectively
unreachable for claude-code, making #3987's fix dead code on this deployment.
child.on("error") catches spawn failures only; it never receives stdio stream errors. A CLI
that exits before draining stdin (an unknown flag on an upgraded binary, an auth abort, an OOM
kill) made the ~250KB stdin write fail with EPIPE on an emitter with no error listener, which
Node escalates to an uncaught exception -> exit(1), taking down every in-flight queue job in
the container.
Per-call temp dirs were never removed. Every AI review minted one and, where repo review
instructions are configured, wrote the composed system prompt into it -- so they accumulated on
the container's writable overlay layer until recreation, leaving those instructions on disk
indefinitely. Removed in the same finally that records CLI usage metrics, best-effort so a
cleanup failure can never turn a completed review into a thrown error.
The systemAppend test now reads the appended-prompt file inside the spawn stub rather than
after the call returns, and additionally asserts the directory does not outlive the call --
which is both the new behaviour and a closer match to how the file is actually used.
1 parent b5cfc9a commit bf1d500
4 files changed
Lines changed: 100 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
601 | 616 | | |
602 | 617 | | |
603 | 618 | | |
| |||
903 | 918 | | |
904 | 919 | | |
905 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
906 | 928 | | |
907 | 929 | | |
908 | 930 | | |
| |||
997 | 1019 | | |
998 | 1020 | | |
999 | 1021 | | |
| 1022 | + | |
1000 | 1023 | | |
1001 | 1024 | | |
1002 | 1025 | | |
| |||
1019 | 1042 | | |
1020 | 1043 | | |
1021 | 1044 | | |
1022 | | - | |
| 1045 | + | |
| 1046 | + | |
1023 | 1047 | | |
1024 | 1048 | | |
1025 | 1049 | | |
| |||
1088 | 1112 | | |
1089 | 1113 | | |
1090 | 1114 | | |
| 1115 | + | |
1091 | 1116 | | |
1092 | 1117 | | |
1093 | 1118 | | |
| |||
1119 | 1144 | | |
1120 | 1145 | | |
1121 | 1146 | | |
| 1147 | + | |
1122 | 1148 | | |
1123 | 1149 | | |
1124 | 1150 | | |
| |||
1136 | 1162 | | |
1137 | 1163 | | |
1138 | 1164 | | |
1139 | | - | |
| 1165 | + | |
1140 | 1166 | | |
1141 | 1167 | | |
1142 | 1168 | | |
| |||
1190 | 1216 | | |
1191 | 1217 | | |
1192 | 1218 | | |
| 1219 | + | |
1193 | 1220 | | |
1194 | 1221 | | |
1195 | 1222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1383 | 1402 | | |
1384 | 1403 | | |
1385 | 1404 | | |
| |||
1633 | 1652 | | |
1634 | 1653 | | |
1635 | 1654 | | |
1636 | | - | |
| 1655 | + | |
1637 | 1656 | | |
1638 | 1657 | | |
1639 | 1658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3515 | 3515 | | |
3516 | 3516 | | |
3517 | 3517 | | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
3518 | 3558 | | |
3519 | 3559 | | |
3520 | 3560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
1603 | 1603 | | |
1604 | 1604 | | |
1605 | 1605 | | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
1606 | 1610 | | |
1607 | 1611 | | |
1608 | 1612 | | |
| 1613 | + | |
| 1614 | + | |
1609 | 1615 | | |
1610 | 1616 | | |
1611 | 1617 | | |
| |||
1625 | 1631 | | |
1626 | 1632 | | |
1627 | 1633 | | |
1628 | | - | |
1629 | | - | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
1630 | 1638 | | |
1631 | 1639 | | |
1632 | 1640 | | |
| |||
0 commit comments