Skip to content

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

Merged
zufayu merged 2 commits into
mainfrom
ci/review-bot-binary-log-budget-watchdog
Dec 4, 2026
Merged

zufayu merged 2 commits into
mainfrom
ci/review-bot-binary-log-budget-watchdog

Conversation

@zufayu

@zufayu zufayu commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

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.sh extracted WORK= from the tee'd fetch log with a bare grep -oE. A PR with binary artifacts (OPUS .co blobs) puts NUL bytes in that log, and a grep without -a answers binary file matches instead of the match — so W came back empty and a fetch that succeeded was reported as a failure, identically on every retry (#8283/#7979/#7983).

Fix: grep -aoE. _fetchfail_test.sh gains case 4: a fetch whose log carries NULs and prints WORK= 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 _request caught only HTTPError, so a socket TimeoutError (an OSError, not an HTTPError) propagated straight through _get and 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 RuntimeError naming 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.py gains real-socket transport checks (the retry lives below the _get/_post seam 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) and AITER_RUN_BUDGET=6900 (115 min/run). 55×2 agents + fetch fits in 115 min, still under the review job's timeout-minutes: 120 — check_prompts.py asserts that coupling, and the AGENT_TIMEOUT×2 ≤ RUN_BUDGET guard in run_one.sh still holds (6600 ≤ 6900). RUNNER-SETUP.md documents the new values.

⚠️ Runner note

These are defaults in run_one.sh. If the box .env pins AITER_AGENT_TIMEOUT or AITER_RUN_BUDGET explicitly, the .env wins — 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 broken

PR Self-Review

Reviewed revision

8dad2e01da9a

Behavior 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.sh extracted WORK= from the tee'd fetch log with a bare grep, so a PR with binary artifacts (OPUS .co blobs 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.py caught only HTTPError, so a 30s socket stall crashed the watchdog with a bare TimeoutError and failed a run whose review had already published a green card (#9178); the retry net names http.client.HTTPException too, so a response that dies mid-body (IncompleteRead — an HTTPException, not an OSError) is retried like a stall and a truncated POST degrades to 0 instead of escaping _post's guard. (3) AITER_AGENT_TIMEOUT=2400s sat 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 the OSError-only catch (a bare IncompleteRead escaped 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 .env files pins AITER_AGENT_TIMEOUT/AITER_RUN_BUDGET (they are auto-written by runner-bootstrap.sh with 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_comment workflows run only from the default branch, so the first @aiter-bot review after 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 in watchdog_test.py cover 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

… 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]>
@zufayu
zufayu requested a review from a team December 4, 2026 04:59
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Lightweight PR hygiene checks

🚦 Update: Heavy CI review gate:

  • 🔒 GPU-heavy PR CI is gated on the current PR review state.
  • ⏸️ Before the latest revision is approved, heavy workflows such as Aiter Test, Triton Test, Flash Attention Integration, and OPUS Test stop at the CI gate and do not consume GPU runners.
  • ▶️ After a non-author approves the current revision, the approval event can start the gated heavy workflows.
  • 🔁 Pushing a new commit invalidates the previous approval for CI purposes; the latest revision needs approval again before heavy CI runs.
  • 🏷️ ci:* labels select which extra tests to run, but labels do not bypass the review gate.
  • ✅ Pushes to main, scheduled runs, and manually dispatched workflows keep their normal behavior.

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 9201 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot changed the title [CI] review-bot: read WORK out of a binary fetch log, retry a stalled watchdog read, size the agent timeouts for the 4-lane pool review-bot: read WORK out of a binary fetch log, retry a stalled watchdog read, size the agent timeouts for the 4-lane pool Dec 4, 2026
@aiter-bot

aiter-bot commented Dec 4, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 8dad2e01da9a · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior 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.sh` extracted `WORK=` from the tee'd fetch log with a bare `grep`, so a PR with binary artifacts (OPUS `.co` blobs 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.py` caught only `HTTPError`, so a 30s socket stall crashed the watchdog with a bare `TimeoutError` and failed a run whose review had already published a green card (#9178); the retry net names `http.client.HTTPException` too, so a response that dies mid-body (`IncompleteRead` — an `HTTPException`, not an `OSError`) is retried like a stall and a truncated POST degrades to 0 instead of escaping `_post`'s guard. (3) `AITER_AGENT_TIMEOUT=2400s` sat 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 the `OSError`-only catch (a bare `IncompleteRead` escaped 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 `.env` files pins `AITER_AGENT_TIMEOUT`/`AITER_RUN_BUDGET` (they are auto-written by `runner-bootstrap.sh` with 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_comment` workflows run only from the default branch, so the first `@aiter-bot review` after 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 in `watchdog_test.py` cover 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](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • FAIL — Aiter Test Gate: failed
  • Required CI failed; fix it before requesting human review.

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu requested a review from gyohuangxin December 4, 2026 05:31
@zufayu

zufayu commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

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 .claude/-only changes (see the "Aiter heavy CI not required: ignored-paths-only" status), so its gate check-run concludes skipped — which pr_self_review.py reads as failed because skipped is not in PASS_CONCLUSIONS. The gate's own required_checks() already drops this requirement for CI-only paths (.github/, docs/); .claude/ tooling is the same class but is not on that list. Shadow mode keeps the commit status success, so nothing is blocked — a follow-up can add .claude/ to CI_ONLY_PREFIXES.

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]>
@zufayu zufayu changed the title review-bot: read WORK out of a binary fetch log, retry a stalled watchdog read, size the agent timeouts for the 4-lane pool 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 Dec 4, 2026
@zufayu
zufayu merged commit 8ec5273 into main Dec 4, 2026
75 of 77 checks passed
@zufayu
zufayu deleted the ci/review-bot-binary-log-budget-watchdog branch December 4, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants