Repository navigation
review-bot: read WORK out of a binary fetch log, retry a stalled or truncated watchdog read, size the agent timeouts for the 4-lane pool - #9201
Conversation
… watchdog read, size the agent timeouts for the 4-lane pool Three failure modes from the 2026-12-04 outage (6 failed runs, 01:24-03:02): - run_one.sh extracted WORK= from the tee'd fetch log with a bare grep, so a PR with binary artifacts (OPUS .co blobs put NULs in that log) made grep answer "binary file matches" instead of the match -- a fetch that SUCCEEDED was reported as "fetch produced no WORK dir" on every retry (#8283/#7979/#7983). grep -a reads the log as text. - watchdog.py caught only HTTPError, so a 30s socket timeout crashed the watchdog with a bare TimeoutError and failed a run whose review had already published a green card (#9178). A stalled GET is now retried (3 attempts, 5s backoff); a POST is never retried, because a retried comment can land twice, and a failed POST degrades to 0, which the caller already warns about. - AITER_AGENT_TIMEOUT=2400s was sized for one review at a time; the 4-lane pool serves four through the same GLM endpoint and workers measured 25-40+ min under that load, so 2400s timed out live while the backend answered normally (#8983/#8541). Defaults now 3300s/agent and 6900s/run (115 min, still under the job's timeout-minutes of 120; check_prompts.py asserts it). watchdog_test.py gains real-socket transport checks (the retry lives below the _get/_post seam its fakes replace) with a mutation guard; _fetchfail_test.sh gains the binary-log case. selftest: 156 green / 0 red. Co-Authored-By: Claude Code <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
🚦 Update: Heavy CI review gate:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
|
Note for the reviewer on the shadow-gate verdict: the one FAIL ("Aiter Test Gate: failed") is a structural false positive for this PR's path class. The Aiter Test workflow ignores Everything else the gate checks is green: author self-review PASS, Copilot findings PASS (none), hygiene PASS, Black/Ruff/dependency PASS. |
A response that dies mid-body raises http.client.IncompleteRead -- an HTTPException, not an OSError -- so the OSError-only retry net added for the 2026-12-04 stall let it escape unretried and unnamed: the same bare-traceback crash one layer up, and _post's RuntimeError guard could not degrade it either. Name the family in the catch so a truncated GET is retried like a stalled one and a truncated POST degrades to 0. Co-Authored-By: Claude Code <[email protected]>
What
Three failure modes from the 2026-12-04 review-bot outage (6 failed runs, 01:24–03:02, triggered by a batch of 8 review requests saturating the 4-lane pool). All three are fixed here; each has a regression check that was shown red before its fix and green after.
1. A successful fetch was reported as "fetch produced no WORK dir" on binary-artifact PRs
run_one.shextractedWORK=from the tee'd fetch log with a baregrep -oE. A PR with binary artifacts (OPUS.coblobs) puts NUL bytes in that log, and a grep without-aanswersbinary file matchesinstead of the match — soWcame back empty and a fetch that succeeded was reported as a failure, identically on every retry (#8283/#7979/#7983).Fix:
grep -aoE._fetchfail_test.shgains case 4: a fetch whose log carries NULs and printsWORK=must be classified as success.2. A 30s socket stall crashed the watchdog and failed a run whose review had already published a green card
watchdog.py's_requestcaught onlyHTTPError, so a socketTimeoutError(anOSError, not anHTTPError) propagated straight through_getand failed the watchdog job — while the review it was watching completed fine (#9178). The run read as a failure over a green review card.Fix: a stalled GET is retried (3 attempts, 5s backoff) and a read that never comes back fails as a
RuntimeErrornaming the path. A POST is never retried — a retried comment can land twice — and a failed POST degrades to status 0, which the caller already warns about.watchdog_test.pygains real-socket transport checks (the retry lives below the_get/_postseam its behaviour fakes replace, so only a real socket exercises it) plus a mutation guard proving the new check bites.3. Agent timeouts were sized for one review at a time, not the 4-lane pool
AITER_AGENT_TIMEOUT=2400s(40 min) was set when one review ran alone. The 4-lane pool (#9037) serves four reviews through the same GLM endpoint, and under that load workers measured 25–40+ min — so 2400s timed out live while the backend answered normally (#8983/#8541).New defaults:
AITER_AGENT_TIMEOUT=3300(55 min/agent) andAITER_RUN_BUDGET=6900(115 min/run). 55×2 agents + fetch fits in 115 min, still under the review job'stimeout-minutes: 120—check_prompts.pyasserts that coupling, and theAGENT_TIMEOUT×2 ≤ RUN_BUDGETguard inrun_one.shstill holds (6600 ≤ 6900).RUNNER-SETUP.mddocuments the new values.These are defaults in
run_one.sh. If the box.envpinsAITER_AGENT_TIMEOUTorAITER_RUN_BUDGETexplicitly, the.envwins — update or remove those lines there or the new sizing will not take effect.Verification
selftest.sh: 156 green / 0 red (baseline 153 + 3 new watchdog transport checks)check_prompts.py: OK, 0 drifts (incl.run budget fits the job cap: 6900s < 7200s)_fetchfail_test.sh: ok (case 4 verified red against the unfixed grep, green after)watchdog_test.py: 31 green / 0 red; both new stall checks verified red against the unfixed watchdog, green after; mutation guard verified red when the retry is brokenPR Self-Review
Reviewed revision
8dad2e01da9aBehavior and intent
Three failure modes from the 2026-12-04 review-bot outage, all in the review pipeline's own tooling — no kernel or op behavior changes. (1)
run_one.shextractedWORK=from the tee'd fetch log with a baregrep, so a PR with binary artifacts (OPUS.coblobs put NUL bytes in that log) made grep answer "binary file matches" instead of the match — a fetch that SUCCEEDED was reported as "fetch produced no WORK dir", identically on every retry (#8283/#7979/#7983). (2)watchdog.pycaught onlyHTTPError, so a 30s socket stall crashed the watchdog with a bareTimeoutErrorand failed a run whose review had already published a green card (#9178); the retry net nameshttp.client.HTTPExceptiontoo, so a response that dies mid-body (IncompleteRead— anHTTPException, not anOSError) is retried like a stall and a truncated POST degrades to 0 instead of escaping_post's guard. (3)AITER_AGENT_TIMEOUT=2400ssat inside the worker-duration tail: workers measured up to 40+ min and hit 2400s even solo, pre-pool (#7580, 2026-12-01), so healthy reviews were killed mid-flight (#8983/#8541).Validation and unverified scope
bash .claude/skills/review-pr/selftest.sh→ 159 green / 0 red (baseline 153 + 6 new watchdog transport checks and mutation guards);python3 .claude/skills/review-pr/check_prompts.py→ OK, 0 drifts (asserts the new 6900s budget fits the 7200s job cap);bash .claude/skills/review-pr/_fetchfail_test.sh→ ok. Each fix was verified red against the unfixed code first, then green: the binary-log case failed against the bare grep, both stall checks failed against the un-retried_request, both truncated-body checks failed against theOSError-only catch (a bareIncompleteReadescaped the GET retry and crashed_post), and the mutation guards prove the retry and catch checks bite. Verified on the runner box (box308): none of the five runner.envfiles pinsAITER_AGENT_TIMEOUT/AITER_RUN_BUDGET(they are auto-written byrunner-bootstrap.shwith no budget lines), so the new defaults take effect on merge; and a cold full clone of the repo on the box's data volume took 83 s (73 s for a warm incremental fetch), inside the 300 s gap the 6900 s budget leaves under the 7200 s job cap. Unverified: no live end-to-end review has run with the new code yet —issue_commentworkflows run only from the default branch, so the first@aiter-bot reviewafter merge is the live check.PR-specific question
The most important boundary is the POST-never-retried rule in
watchdog.py: a retried comment POST can land twice, so only GETs retry (3 attempts, 5s backoff) and a failed POST degrades to status 0, which the caller already warns about. Evidence: the real-socket transport checks and the mutation guard inwatchdog_test.pycover both sides — a stalled GET is retried, a never-returning GET fails as a named error, and breaking the retry turns the check red.Changed op tests
None — no
op_tests/file changed; the regression coverage lives in the skill's own suite (selftest.sh,watchdog_test.py,_fetchfail_test.sh).🤖 Generated with Claude Code