Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7ee7cea
fix(triage): finalize the status comment on cancellation too
Aug 3, 2026
8569cd7
test(triage): pin the cancelled finalize condition in the shape test
qwen-code-dev-bot Aug 3, 2026
4014085
fix(triage): finalize status comment only on this run's own comment
qwen-code-dev-bot Aug 3, 2026
d453112
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 3, 2026
b257a03
Merge branch 'main' into fix/triage-status-comment-cancelled
wenshao Aug 3, 2026
a2aa71b
Merge branch 'main' into fix/triage-status-comment-cancelled
wenshao Aug 4, 2026
90fc940
Merge branch 'main' into fix/triage-status-comment-cancelled
wenshao Aug 4, 2026
0958ea8
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 4, 2026
c67187c
test(triage): pin the last-comment selector in the finalize ownership…
qwen-code-dev-bot Aug 4, 2026
1ec4150
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 4, 2026
fa10cfe
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 4, 2026
5c55b2f
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 5, 2026
8e130d0
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 5, 2026
1beca48
fix(triage): harden finalize ownership pins and document lane race
qwen-code-dev-bot Aug 5, 2026
efda1e2
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 5, 2026
40a1ff0
fix(triage): bound finalize ownership match to the exact run link
qwen-code-dev-bot Aug 5, 2026
3ce449b
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 5, 2026
f2fa5f5
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 5, 2026
ad440db
fix(triage): never strand a running claim in the finalize step
qwen-code-dev-bot Aug 6, 2026
e475fa4
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 6, 2026
2d14f51
fix(triage): reclaim stranded running claims in the claim step (#8436)
qwen-code-dev-bot Aug 6, 2026
4708d1a
fix(triage): keep the finalize status flip off live running claims (#…
qwen-code-dev-bot Aug 6, 2026
060c2c2
Merge branch 'main' into fix/triage-status-comment-cancelled
qwen-code-dev-bot Aug 6, 2026
02aad77
fix(triage): key the status finalize on the claim's exported comment …
qwen-code-dev-bot Aug 7, 2026
b8ac04e
fix(triage): pin claim --jq '.id' extraction and document finalize em…
qwen-code-dev-bot Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/qwen-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,20 @@ jobs:
# "running" line doesn't outlive the run. Neutral wording — the verdict
# lives in the stage comments above; this only records that the run ended
# and keeps the run link. Same marker → edits the one comment, no second
# post. Best-effort, on both success and failure.
# post. Best-effort, on success, failure, AND cancellation: always() (not
# success() || failure()) because the job-level timeout-minutes and a
# manual cancel both surface as cancellation, which would skip this step

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Suggestion] This comment enumerates "the job-level timeout-minutes and a manual cancel" as the causes of cancellation, and the new user-facing string at L979 asserts the same two — but neither is the dominant source of cancellation in this job.

The job sets cancel-in-progress: true for pull_request_target, issue_comment, issues and workflow_dispatch (L392-402), so every push to an open PR cancels the in-flight triage. That run's always() finalize fires immediately, while the successor still has to acquire a runner, run authorize, and check out (≥1 min) — so the losing run's message usually wins the race and the PR shows "🚫 Qwen Triage was cancelled — … The run hit its time limit or was cancelled before finishing; re-run to get a result" while a newer run is already in flight and no re-run is needed. job.status == 'cancelled' alone cannot tell supersession from a timeout; github.event_name plus a supersession probe can. At minimum the wording should not prescribe a re-run it cannot know is necessary.

中文说明

建议:该注释把「job 级 timeout-minutes 和手动取消」列为取消的成因,L979 新增的用户可见文案也断言了同样两点——但这两者都不是本 job 取消的主要来源。

该 job 对 pull_request_target、issue_comment、issues 与 workflow_dispatch 设置了 cancel-in-progress: true(L392-402),因此向开放 PR 的每一次 push 都会取消进行中的 triage。被取消 run 的 always() 收尾会立刻触发,而后继 run 还要抢 runner、跑 authorize、checkout(≥1 分钟)——于是通常是失败方的消息赢得竞速,PR 上显示 "🚫 Qwen Triage was cancelled — … The run hit its time limit or was cancelled before finishing; re-run to get a result",而此时更新的 run 已在运行,根本不需要重跑。仅凭 job.status == 'cancelled' 无法区分被取代与超时;结合 github.event_name 及一次取代探测则可以。至少,文案不应给出一个它无从判断是否必要的重跑建议。

# and leave the comment claiming the run is still in progress — the verify
# lane has publish-verify to catch that case, this lane only has us.
- name: 'Finalize triage status comment'
if: "(success() || failure()) && steps.resolve.outputs.number != ''"
if: "always() && steps.resolve.outputs.number != ''"
shell: 'bash'
env:
GH_TOKEN: '${{ secrets.QWEN_CODE_BOT_TOKEN || secrets.CI_BOT_PAT }}'
NUMBER: '${{ steps.resolve.outputs.number }}'
RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
TRIAGE_OUTCOME: '${{ steps.triage.outcome }}'
JOB_STATUS: '${{ job.status }}'
run: |-
set -uo pipefail
MARKER='<!-- qwen-triage lifecycle -->'
Expand All @@ -942,6 +947,9 @@ jobs:
if [ "${TRIAGE_OUTCOME:-}" = 'success' ]; then

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Critical] TRIAGE_OUTCOME = 'success' is tested before anything job-scoped, so a run whose job failed still posts "✅ Qwen Triage finished — … See the stage comments in this thread for the result." The PR introduces JOB_STATUS but never uses it to gate the success wording.

Failure scenario: Check triage response (L815-841) exits 1 with ::error title=Triage silent failure precisely when the action succeeded but returned an empty summary — i.e. steps.triage.outcome == 'success' while job.status == 'failure'. Verified by running the extracted script with TRIAGE_OUTCOME=success JOB_STATUS=failure: it emits the ✅ wording, on a red run that produced no stage comments at all, pointing the maintainer at a thread that has nothing in it. Same for a failing Notify silent triage re-run (it runs under set -euo pipefail with an unguarded final gh api … -f body="$BODY").

The suggestion keeps the deliberate {success, cancelled} → finished row documented at scripts/tests/qwen-triage-workflow.test.js L594-596 and routes only {success, failure} to the "ended early" wording.

Suggested change
if [ "${TRIAGE_OUTCOME:-}" = 'success' ]; then
if [ "${TRIAGE_OUTCOME:-}" = 'success' ] && [ "${JOB_STATUS:-}" != 'failure' ]; then
中文说明

严重:TRIAGE_OUTCOME = 'success' 的判断排在所有 job 级信息之前,因此 job 失败的 run 仍然会发出 "✅ Qwen Triage finished — … See the stage comments in this thread for the result."。本 PR 引入了 JOB_STATUS,却从未用它来约束成功措辞。

失败场景:Check triage response(L815-841)恰恰在 action 成功但返回空摘要时以 ::error title=Triage silent failure 退出 1——即 steps.triage.outcome == 'success' 而 job.status == 'failure'。已用提取出的脚本以 TRIAGE_OUTCOME=success JOB_STATUS=failure 验证:它输出 ✅ 措辞,而这次红色的 run 根本没有产生任何阶段评论,等于把维护者指向一个空线程。Notify silent triage re-run 失败时同理(它在 set -euo pipefail 下运行,最后一条 gh api … -f body="$BODY" 无兜底)。

建议保留了 scripts/tests/qwen-triage-workflow.test.js L594-596 中刻意记录的 {success, cancelled} → finished 一行,只把 {success, failure} 引流到 "ended early" 措辞。

EN="✅ **Qwen Triage finished** — [view run]($RUN_URL). See the stage comments in this thread for the result."
ZH="✅ **Qwen Triage 已完成** —— [查看运行]($RUN_URL)。结果见本线程中的各阶段评论。"
elif [ "${JOB_STATUS:-}" = 'cancelled' ]; then
EN="🚫 **Qwen Triage was cancelled** — [view run]($RUN_URL). The run hit its time limit or was cancelled before finishing; re-run to get a result."
ZH="🚫 **Qwen Triage 已取消** —— [查看运行]($RUN_URL)。运行超时或被取消,未跑完;重新运行以获得结果。"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Suggestion] Nit: the new Chinese string uses half-width ASCII , and ; inside CJK text, against this file's own convention.

grep -P '[\x{4e00}-\x{9fff}][,;]' over the 4237-line workflow matches exactly two lines: this new one and the pre-existing L983 it was copied from, while 11 other Chinese strings use full-width , / ;. ASCII punctuation renders with wrong spacing in CJK text, and the new test pins this ZH wording, locking it in.

Suggested change
ZH="🚫 **Qwen Triage 已取消** —— [查看运行]($RUN_URL)。运行超时或被取消,未跑完;重新运行以获得结果。"
ZH="🚫 **Qwen Triage 已取消** —— [查看运行]($RUN_URL)。运行超时或被取消,未跑完;重新运行以获得结果。"
中文说明

建议:细节——新增的中文串在 CJK 文本中使用了半角 ASCII 的 , 与 ;,与本文件自身的约定不符。

对这个 4237 行的 workflow 执行 grep -P '[\x{4e00}-\x{9fff}][,;]' 只匹配到两行:这条新增的,以及它所复制的既有 L983;而另外 11 条中文串都用全角 , / ;。ASCII 标点在中文文本中渲染出的间距是错的,而新测试钉住了这段 ZH 文案,会把它固化下来。

else
EN="⚠️ **Qwen Triage ended early** — [view run]($RUN_URL). It stopped before finishing; check the run log."
ZH="⚠️ **Qwen Triage 提前结束** —— [查看运行]($RUN_URL)。未跑完,请查看运行日志。"
Expand Down
15 changes: 13 additions & 2 deletions scripts/tests/qwen-triage-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,24 @@ describe('qwen-triage tmux workflow', () => {
expect(statusStep).toContain('continuing.');

const finalizeStep = step('Finalize triage status comment');
// Runs on both outcomes and edits the SAME marker comment (no second post).
// Runs on EVERY terminal outcome and edits the SAME marker comment (no
// second post). always(), not success() || failure(): the job timeout and
// a manual cancel surface as cancellation, which skipped the step and left
// the early comment claiming the run was still in progress.
expect(finalizeStep).toContain("MARKER='<!-- qwen-triage lifecycle -->'");
expect(finalizeStep).toContain(
"LEGACY_MARKER='<!-- qwen-triage stage=status -->'",
);
expect(finalizeStep).toContain('success() || failure()');
expect(finalizeStep).toContain(
'if: "always() && steps.resolve.outputs.number != \'\'"',
);
expect(finalizeStep).not.toContain('success() || failure()');
expect(finalizeStep).toContain('steps.triage.outcome');
expect(finalizeStep).toContain("JOB_STATUS: '${{ job.status }}'");
expect(finalizeStep).toContain('Qwen Triage was cancelled');
expect(finalizeStep).toContain(
'elif [ "${JOB_STATUS:-}" = \'cancelled\' ]',
);
expect(finalizeStep).toContain(
'Cannot resolve bot identity; skipping final status comment upsert.',
);
Expand Down
Loading