Skip to content
11 changes: 10 additions & 1 deletion .github/workflows/qwen-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,16 @@ jobs:

triage:
needs: ['authorize']
timeout-minutes: 30
# TUNABLE WITHOUT A CODE CHANGE: set the repository variable in
# Settings → Variables. Why the fallback is 60: the fixed 30 was
# measurably clipping the distribution — 22 successful triage jobs
# sampled on 2026-08-09 ran median 5.8m / p90 22.3m / max 29.5m, and
# five substantial PRs (8723, 8726, 8731, 8764, 8801) died at exactly
# the cap, each discarding a full agent run. Triage is advisory, so
# the worst case a longer budget risks is one held runner; a killed
# run wastes the same runner AND the work. The fromJSON(vars.X || N)
# form is probe-verified on a live runner (see #8731).
timeout-minutes: '${{ fromJSON(vars.QWEN_TRIAGE_TIMEOUT_MINUTES || 60) }}'
Comment thread
wenshao marked this conversation as resolved.
Resolved
concurrency:
# GitHub evaluates concurrency before the job `if`, but after `needs`.
# Keep non-runnable PR/comment triggers out of the shared per-number
Expand Down
17 changes: 17 additions & 0 deletions scripts/tests/qwen-triage-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5847,3 +5847,20 @@ describe('qwen-triage build-process guard', () => {
}
}, 30000);
});

describe('triage job budget', () => {
Comment thread
doudouOUC marked this conversation as resolved.
Resolved
// The fixed 30-minute cap was measurably clipping the distribution: 22
// successful triage jobs sampled on 2026-08-09 ran median 5.8m / p90
// 22.3m / max 29.5m, and five substantial PRs died at exactly the cap,
// each discarding a full agent run for nothing — triage is advisory, so
// a killed run wastes the runner AND the work it was about to publish.
// The budget is a repository variable so the next resize needs no PR;
// the fallback keeps an unconfigured repo bounded. Both halves pinned so
// neither the knob nor its default can silently vanish.
it('is operator-tunable with a bounded fallback', () => {
const triageJob = job('triage');
expect(triageJob).toContain(
"timeout-minutes: '${{ fromJSON(vars.QWEN_TRIAGE_TIMEOUT_MINUTES || 60) }}'",
);
Comment thread
wenshao marked this conversation as resolved.
Resolved
});
});
Loading