Repository navigation
fix(autofix): stop counting idle timeouts toward the timeout cap #9673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
536d209
af470fe
3bd4a50
ee13b2e
36e0a45
4a47aac
d016403
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||
|
|
@@ -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' | ||
|
|
@@ -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)" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 中文说明与上方线程为同一发现(R1-3)—— 按该线程记录的理由顺延至下一轮:本轮批次上限为 8 条发现(Critical 优先)。本条同样复核了该论断(prepare 步骤的 |
||
| if [[ "${AGENT_TIMEOUT:-}" == 'idle-timeout'* ]]; then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 中文说明顺延至下一轮 —— 本轮批次上限为 8 条发现(Critical 优先):本轮已落地变红的 CI 的 Critical 以及 R1-2、R1-5、R1-6、R1-7、R1-8、R1-9、R1-10。 该缺口维持原报告所述,本轮改动也未将其关闭:目前没有任何测试从 run-agent.mjs 的 detail 模板、工作流的当前轮
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
There was a problem hiding this comment.
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_TIMEOUTSjq verbatim against a window holding one successful round and one pure idle round returns1, 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_TIMEOUTSjq,对"一次成功轮次 + 一次纯 idle 轮次"的窗口返回1,即 idle 轮次确实会以"耗尽了 agent 时间预算且一无所获"上报给下一轮 agent。修复它需要在本发现给出的两个政策分叉中做选择 —— 在姊妹普查点同样排除 idle(复用完全相同的匹配串),或在 af-073 中记录该反馈警告有意统计 idle 轮次 —— 其中排除方案还需要 prepare 步骤自己的测试见证。该决策及其见证放到下一轮落地。