Skip to content
Merged
53 changes: 53 additions & 0 deletions .github/workflows/qwen-autofix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2072,3 +2072,56 @@ publishing" and report a successful round as a failed one. An empty
'stale' (prepare itself crashed) still finalises — that IS this job's
round, and it is exactly the case that must not stay "working".
```

<a id="af-073"></a>

### 73. review-address · Report dry-run / failure — Idle (silent-sandbox) timeouts are EXCLUDED from the cumulative timeout cap.

In `review-address` · `Report dry-run / failure`.

```text
TIMEOUT_WINDOW_CAP exists to stop a PR that is too big to finish a
round inside the agent's time budget; its remedy says so ("split or
reduce the PR, or raise the agent time budget AND its step backstop").
An idle timeout is a different failure entirely: run-agent.mjs's idle
watchdog kills the round after QWEN_IDLE_TIMEOUT_MS (20m) because the
sandbox produced no output at all — the four observed hangs (#8663 x2,
#8761 r3, #8763 r4) each printed their last byte at docker container
entry and then sat silent. Nothing about the PR caused it, and the
breaker's own headline already told the reader that "no budget increase
can cure" it. Counting a failure whose prescribed remedy is
inapplicable is what parked healthy PRs.

Measured on 2026-08-21, over the preceding 14 days: 119 timeouts, of
which 58 (49%) were idle. 51 windows tripped this cap, every one of
them at exactly N=3. Of the 12 open PRs then carrying
autofix/needs-human, 9 had been stopped here — #8332 at 24 rounds,
#8368 at 28, #8276 at 16, all still producing pushed rounds when they
were parked. With idle rounds counted, the fleet timeout rate was
8.5% per round, so a window accumulated three of them in ~35 rounds by
arithmetic alone, independent of whether the PR was stuck. Excluding
idle drops the rate to 4.3%, which needs ~69 rounds — beyond the
deepest window ever observed (22/100).

The escape hatch that makes the exclusion safe: an idle round pushes
nothing and matches none of CONSEC_FAIL's streak-reset needles
("Addressed the latest review feedback", "no changes needed", "AutoFix
could not start", "updated a stale base"), so a persistently wedged
sandbox still terminates the PR at CONSECUTIVE_FAILURE_CAP. What no
longer terminates it is idle rounds INTERLEAVED with real progress —
which is the intended change: that PR is not stuck, the runner is.

Two consequences inside the block. IDLE_N's needle became the full
emitted headline prefix ('AutoFix ran out of time before finishing
(idle-timeout') rather than a bare 'idle-timeout' substring: IDLE_N is
now subtracted from TIMEOUT_N, so it MUST be a subset of it, and a
loose needle could otherwise match provider error text that
API_ERROR_DETAIL puts on the same first line and drive the difference
negative. And the all-idle remedy branch is gone as unreachable: the
guard now fires only when BUDGET_TIMEOUT_N alone reaches the cap, so a
counted window always holds more budget timeouts than idle ones.

Idle rounds stay visible through a job-log ::warning:: rather than a PR
comment — the signal belongs to whoever owns the runners, and infra
noise should not spend a comment on someone's PR.
```
50 changes: 31 additions & 19 deletions .github/workflows/qwen-autofix.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: 'Qwen Autofix'

# One workflow for the whole autonomous-fix lifecycle:
Expand Down Expand Up @@ -245,7 +245,9 @@
# pushed rounds in between, so the consecutive cap never fired and the PR
# kept walking into the same wall; #7846 the same, twice. Counted over the
# current counting window (window-scoped like every other census), so a
# re-arm clears it along with the round counter.
# re-arm clears it along with the round counter. Counts BUDGET timeouts
# only: silent-sandbox (idle) timeouts are infra, not PR size, and are
# excluded — see qwen-autofix.md#af-073.
TIMEOUT_WINDOW_CAP: '3'
# Do not claim more issues when too many existing autofix PRs are still open.
MAX_OPEN_AUTOFIX_PRS: '5'
Expand Down Expand Up @@ -6683,38 +6685,48 @@
if [[ -n "${AGENT_TIMEOUT:-}" ]]; then
TIMEOUT_N=$(( TIMEOUT_N + 1 ))
fi
# Idle (silent-sandbox) timeouts share the census — they burn
# the same full budget — but no budget increase cures them, so
# when the window contains any, the breaker says so.
IDLE_N="$(grep -c 'idle-timeout' <<< "${PRIOR_HEADS}" || true)"
# Idle (silent-sandbox) timeouts are EXCLUDED from this cap:
# a wedged runner/docker is not this PR being too big, an idle
# round dies at QWEN_IDLE_TIMEOUT_MS having produced no byte
# (a fraction of a real round), and no budget increase cures
# one — so this breaker's remedy does not apply to them. A
# persistently wedged sandbox stays bounded by
# CONSECUTIVE_FAILURE_CAP, which an idle round DOES feed.
# Full rationale → qwen-autofix.md#af-073
# The needle is the emitted headline verbatim AND a prefix of
# TIMEOUT_N's, so IDLE_N can never exceed it and the
# subtraction below can never go negative.
IDLE_N="$(grep -c 'AutoFix ran out of time before finishing (idle-timeout' <<< "${PRIOR_HEADS}" || true)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred to the next round — this round's batch was capped at 8 findings (Critical first): it landed the red-CI Critical (missing af-073 TOC entry) plus R1-2, R1-5, R1-6, R1-7, R1-8, R1-9, and R1-10.

The finding itself is verified, not disputed: running the prepare step's PRIOR_TIMEOUTS jq verbatim against a window holding one successful round and one pure idle round returns 1, so an idle round is indeed reported to the next round's agent as "exhausted the agent time budget before finishing anything". Closing it is the policy fork the finding frames — apply the same idle exclusion at the sibling site (reusing the exact needle), or record in af-073 that the feedback warning deliberately counts idle rounds — and the exclusion option carries its own prepare-step test obligation. That decision and its witness land next round.

中文说明

顺延至下一轮 —— 本轮批次上限为 8 条发现(Critical 优先):本轮已落地变红的 CI 的 Critical(af-073 目录条目缺失)以及 R1-2、R1-5、R1-6、R1-7、R1-8、R1-9、R1-10。

该发现本身已核实、并无争议:逐字运行 prepare 步骤的 PRIOR_TIMEOUTS jq,对"一次成功轮次 + 一次纯 idle 轮次"的窗口返回 1,即 idle 轮次确实会以"耗尽了 agent 时间预算且一无所获"上报给下一轮 agent。修复它需要在本发现给出的两个政策分叉中做选择 —— 在姊妹普查点同样排除 idle(复用完全相同的匹配串),或在 af-073 中记录该反馈警告有意统计 idle 轮次 —— 其中排除方案还需要 prepare 步骤自己的测试见证。该决策及其见证放到下一轮落地。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same finding as the thread above (R1-3) — deferred to the next round for the reason recorded there: this round's batch was capped at 8 findings (Critical first). The claim was re-verified here as well (the prepare step's PRIOR_TIMEOUTS jq counts a pure idle round as 1 budget exhaustion); the policy decision and its test witness land next round.

中文说明

与上方线程为同一发现(R1-3)—— 按该线程记录的理由顺延至下一轮:本轮批次上限为 8 条发现(Critical 优先)。本条同样复核了该论断(prepare 步骤的 PRIOR_TIMEOUTS jq 会把一次纯 idle 轮次计为 1 次预算耗尽);政策决策及其测试见证放到下一轮落地。

if [[ "${AGENT_TIMEOUT:-}" == 'idle-timeout'* ]]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred to the next round — this round's batch was capped at 8 findings (Critical first): it landed the red-CI Critical plus R1-2, R1-5, R1-6, R1-7, R1-8, R1-9, and R1-10.

The gap stands as reported and nothing in this round's changes closes it: no test derives the idle classification across run-agent.mjs's detail template, the workflow's current-round 'idle-timeout'* prefix test, the CAUSE/HEADLINE assembly, and the census needle, so a reword at any one of the three sites would silently declassify idle rounds while the suite stays green. The requested composition test (extract the detail template, prefix tokens, CAUSE template, and IDLE_N needle from the real sources and assert their composition) lands next round.

中文说明

顺延至下一轮 —— 本轮批次上限为 8 条发现(Critical 优先):本轮已落地变红的 CI 的 Critical 以及 R1-2、R1-5、R1-6、R1-7、R1-8、R1-9、R1-10。

该缺口维持原报告所述,本轮改动也未将其关闭:目前没有任何测试从 run-agent.mjs 的 detail 模板、工作流的当前轮 'idle-timeout'* 前缀判断、CAUSE/HEADLINE 拼装与普查匹配串之间互相推导,因此三处点位中任何一处的措辞变化都会悄无声息地把 idle 轮次除名而套件保持绿色。所要求的组合测试(从真实源码提取 detail 模板、前缀词元、CAUSE 模板与 IDLE_N 匹配串并断言其组合关系)放到下一轮落地。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same finding as the thread above (R1-4) — deferred to the next round for the reason recorded there: this round's batch was capped at 8 findings (Critical first). The composition test tying the three idle-classification sites together lands next round.

中文说明

与上方线程为同一发现(R1-4)—— 按该线程记录的理由顺延至下一轮:本轮批次上限为 8 条发现(Critical 优先)。把三个 idle 分类点位钉在一起的组合测试放到下一轮落地。

IDLE_N=$(( IDLE_N + 1 ))
fi
if [[ "${TIMEOUT_N}" -ge "${TIMEOUT_WINDOW_CAP}" ]]; then
BUDGET_TIMEOUT_N=$(( TIMEOUT_N - IDLE_N ))
# Excluding idle from the cap must not hide it. The job log is
# the right surface: it reaches the operator without spending a
# PR comment on infra noise.
if [[ "${IDLE_N}" -gt 0 ]]; then
echo "::warning::#${PR}: ${IDLE_N} silent-sandbox (idle) timeout(s) this counting window — excluded from the ${TIMEOUT_WINDOW_CAP}-timeout cap; check the sandbox image and the runner docker daemon"
fi
if [[ "${BUDGET_TIMEOUT_N}" -ge "${TIMEOUT_WINDOW_CAP}" ]]; then
MARK_ROUND="${MAX_ROUNDS}"
# The headline states what the census MEASURED — the
# window's cumulative count — not "stopped after N
# timeouts": the round that trips this can itself have
# failed differently (a gate rejection landing on a window
# that already carries the cap — the exact rollout state
# of #7929/#7846).
# No all-idle branch here: the guard above only fires when
# BUDGET_TIMEOUT_N alone reaches the cap, so a counted
# window always holds more budget timeouts than idle ones
# and the budget remedy is always the right one.
IDLE_CLAUSE=''
IDLE_CLAUSE_ZH=''
if [[ "${IDLE_N}" -gt 0 ]]; then
IDLE_CLAUSE=" ${IDLE_N} of those were silent-sandbox (idle) timeouts that no budget increase can cure — investigate the sandbox image and runner docker daemon for those."
IDLE_CLAUSE_ZH="其中 ${IDLE_N} 次是静默 sandbox(idle)超时,提高预算也治不了 —— 请针对这些排查 sandbox 镜像与 runner 的 docker daemon。"
fi
# Mirror the round-level split: when EVERY counted timeout
# was idle, the closing remedy must not prescribe the
# budget increase the clause above just declared useless.
REMEDY='split or reduce the PR (or raise the agent time budget AND its step backstop together)'
REMEDY_ZH='拆分或缩减该 PR(或同时提高 agent 时间预算与其步骤兜底)'
if [[ "${IDLE_N}" -ge "${TIMEOUT_N}" ]]; then
REMEDY='investigate the sandbox image and runner docker daemon'
REMEDY_ZH='排查 sandbox 镜像与 runner 的 docker daemon'
IDLE_CLAUSE=" The window also holds ${IDLE_N} silent-sandbox (idle) timeout(s), which no budget increase can cure and which do NOT count toward this cap — investigate the sandbox image and runner docker daemon separately."
IDLE_CLAUSE_ZH="本窗口另有 ${IDLE_N} 次静默 sandbox(idle)超时,提高预算也治不了,且不计入本上限 —— 请另行排查 sandbox 镜像与 runner 的 docker daemon。"
fi
HEADLINE="🤖 AutoFix stopped: this counting window now contains ${TIMEOUT_N} time-budget exhaustions (pushed rounds in between included; this round itself may have failed differently). That is ${TIMEOUT_N} full agent runs that pushed nothing.${IDLE_CLAUSE} A human should ${REMEDY}, then comment \`${RETRY_COMMAND}\` to re-arm. Until then future scans will skip this PR."
HEADLINE_ZH="🤖 AutoFix 已停止:当前计数窗口内已累计 ${TIMEOUT_N} 次时间预算耗尽(含其间推送过的轮次;本轮本身可能以别的方式失败)。即 ${TIMEOUT_N} 次完整 agent 运行没有推送任何内容。${IDLE_CLAUSE_ZH}应由人工${REMEDY_ZH},然后评论 \`${RETRY_COMMAND}\` 重新武装。在此之前,后续扫描将跳过本 PR。"
HEADLINE="🤖 AutoFix stopped: this counting window now contains ${BUDGET_TIMEOUT_N} agent time-budget exhaustions (pushed rounds in between included; this round itself may have failed differently). That is ${BUDGET_TIMEOUT_N} full agent runs that pushed nothing.${IDLE_CLAUSE} A human should split or reduce the PR (or raise the agent time budget AND its step backstop together), then comment \`${RETRY_COMMAND}\` to re-arm. Until then future scans will skip this PR."
HEADLINE_ZH="🤖 AutoFix 已停止:当前计数窗口内已累计 ${BUDGET_TIMEOUT_N} 次时间预算耗尽(含其间推送过的轮次;本轮本身可能以别的方式失败)。即 ${BUDGET_TIMEOUT_N} 次完整 agent 运行没有推送任何内容。${IDLE_CLAUSE_ZH}应由人工拆分或缩减该 PR(或同时提高 agent 时间预算与其步骤兜底),然后评论 \`${RETRY_COMMAND}\` 重新武装。在此之前,后续扫描将跳过本 PR。"
fi
fi
fi
Expand Down
Loading
Loading