From 7e5e02338edc312ada1f9549cc2af8b60ee20ec0 Mon Sep 17 00:00:00 2001 From: wenshao Date: Tue, 21 Jul 2026 17:25:11 +0800 Subject: [PATCH 1/2] feat(autofix): raise the strict round cap from 5 to 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured across the last 40 bot-authored PRs: 17 finished at round 0, 12 at 1, 4 at 2, 2 at 3, 1 at 4, and 3 reached the cap of 5. All three that reached it merged AT it rather than stalling — and one of those spent two of its five rounds on the verify-gate ENOENT that #7330 has since fixed. So the ceiling was never the thing that stopped a PR, but it sat close enough to bind on a bad day with no headroom. 10 gives that headroom. The cap exists to stop an unproductive LOOP, not to ration ordinary iteration; a genuinely stuck PR still stops, just later. Deliberately not larger: retries for a transient model or gate failure increment the same counter, so the cap also bounds how much one bad provider window can spend. API_AUTH_MAX_ROUNDS stays at 3 and still short-circuits the errors only a maintainer can fix. Replaces the literal `MAX_ROUNDS: '5'` assertion with the ordering the numbers must satisfy — auth cap < strict cap < takeover cap — so the values stay tunable and a cap that stops binding fails instead. --- .github/workflows/qwen-autofix.yml | 9 +++++++-- scripts/tests/qwen-autofix-workflow.test.js | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/qwen-autofix.yml b/.github/workflows/qwen-autofix.yml index fca1b5cbc95..f9bb4a86cd9 100644 --- a/.github/workflows/qwen-autofix.yml +++ b/.github/workflows/qwen-autofix.yml @@ -106,8 +106,13 @@ env: # hostile commenter cannot steer the agent. TRUSTED_ASSOC: '["OWNER", "MEMBER", "COLLABORATOR"]' # Hard cap on automated review-address rounds per PR. After this the bot stops - # and leaves the PR for a human. - MAX_ROUNDS: '5' + # and leaves the PR for a human. Raised from 5: across the last 40 bot PRs + # only 3 ever reached the cap and all 3 merged AT it (one having spent two of + # its five rounds on the verify-gate ENOENT that #7330 fixed), so the ceiling + # was near enough to bind on a bad day without any headroom for one. The cap + # exists to stop an unproductive LOOP, not to ration ordinary iteration — + # a genuinely stuck PR still stops, just later. + MAX_ROUNDS: '10' # An auth/access model error (401/402/403, "no access"/"does not exist") # never self-heals - only a maintainer can fix the key - and every retry # costs an agent run AND a PR comment. Cap those attempts far below diff --git a/scripts/tests/qwen-autofix-workflow.test.js b/scripts/tests/qwen-autofix-workflow.test.js index c8b6094916e..c2341ff2c05 100644 --- a/scripts/tests/qwen-autofix-workflow.test.js +++ b/scripts/tests/qwen-autofix-workflow.test.js @@ -218,7 +218,21 @@ describe('qwen-autofix workflow', () => { expect(workflow).toContain( 'AUTOFIX_BOT: "${{ vars.AUTOFIX_BOT_LOGIN || \'qwen-code-dev-bot\' }}"', ); - expect(workflow).toContain("MAX_ROUNDS: '5'"); + // The round budgets are tuning knobs; what must hold is their ORDERING. + // Asserting the literal numbers only detected edits — it would not catch + // a cap that stopped binding, which is the failure that matters. + const num = (key) => + Number(workflow.match(new RegExp(`${key}: '(\\d+)'`))?.[1]); + const strictRounds = num('MAX_ROUNDS'); + const takeoverRounds = num('TAKEOVER_MAX_ROUNDS'); + const authRounds = num('API_AUTH_MAX_ROUNDS'); + // A strict cap at or above the takeover cap makes the takeover label a + // no-op; an auth sub-cap at or above the strict cap stops short-circuiting + // the retries only a maintainer can fix, which is what it exists for. + expect(strictRounds).toBeGreaterThan(0); + expect(strictRounds).toBeLessThan(takeoverRounds); + expect(authRounds).toBeGreaterThan(0); + expect(authRounds).toBeLessThan(strictRounds); expect(workflow).toContain("MAX_OPEN_AUTOFIX_PRS: '5'"); expect(reviewScanJob).toContain('isCrossRepository'); expect(reviewScanJob).toContain('not an open main-targeting PR'); From 43ea367f8fbd1495b6ff8e0a322c2f263e65093d Mon Sep 17 00:00:00 2001 From: qwen-code-ci-bot Date: Tue, 21 Jul 2026 10:47:36 +0000 Subject: [PATCH 2/2] fix(scripts): anchor round-cap regex with word boundary (#7412) --- scripts/tests/qwen-autofix-workflow.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/qwen-autofix-workflow.test.js b/scripts/tests/qwen-autofix-workflow.test.js index c2341ff2c05..bc6b2004673 100644 --- a/scripts/tests/qwen-autofix-workflow.test.js +++ b/scripts/tests/qwen-autofix-workflow.test.js @@ -222,7 +222,7 @@ describe('qwen-autofix workflow', () => { // Asserting the literal numbers only detected edits — it would not catch // a cap that stopped binding, which is the failure that matters. const num = (key) => - Number(workflow.match(new RegExp(`${key}: '(\\d+)'`))?.[1]); + Number(workflow.match(new RegExp(`\\b${key}: '(\\d+)'`))?.[1]); const strictRounds = num('MAX_ROUNDS'); const takeoverRounds = num('TAKEOVER_MAX_ROUNDS'); const authRounds = num('API_AUTH_MAX_ROUNDS');