Repository navigation
fix(cli): preserve Qwen Review startup version in footers #8431
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b8f5cf2
fix(cli): preserve review startup version in footers
yiliang114 8eae4f4
fix(cli): keep review startup version dynamic in bundle
yiliang114 269b8c0
fix(cli): reset review version after managed update
yiliang114 58b1949
test(cli): use indexed env access
yiliang114 72af48c
Merge branch 'main' into codex/fix-review-footer-startup-version
wenshao 0a66cec
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 348946c
fix(cli): harden review footer strip and version stamping (#8431)
qwen-code-ci-bot 899bea0
Merge branch 'main' into codex/fix-review-footer-startup-version
qwen-code-dev-bot e47f7e9
fix(tests): sync qwen-resolve-workflow expectations with externalized…
qwen-code-ci-bot 031d21a
Merge remote-tracking branch 'origin/main' into codex/fix-review-foot…
qwen-code-ci-bot e58261e
fix(cli): harden the review footer strip per review feedback (#8431)
qwen-code-ci-bot 47e0a84
Merge branch 'main' into codex/fix-review-footer-startup-version
qwen-code-dev-bot 722a818
fix(cli): strip review footers before ledger carryover
yiliang114 27e6882
Merge branch 'main' into codex/fix-review-footer-startup-version
qwen-code-dev-bot 7a39909
fix(cli): align ledger footer regression expectation
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/cli/src/commands/review/lib/review-footer.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2026 Qwen Team | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { describe, expect, it } from 'vitest'; | ||
| import { REVIEW_FOOTER_RE, reviewFooter } from './review-footer.js'; | ||
|
|
||
| describe('the review footer and the regex that strips it', () => { | ||
| it('the regex strips the exact output of the builder, versioned or not', () => { | ||
| // The sync guarantee: a wording edit to the builder that the regex no | ||
| // longer matches reddens here before it reaches a posted review. | ||
| for (const footer of [ | ||
| reviewFooter('qwen3.7-max', '0.21.3'), | ||
| '_— qwen3.7-max via Qwen Code /review_', | ||
| ]) { | ||
| expect(`a finding\n\n${footer}\n`.replace(REVIEW_FOOTER_RE, '')).toBe( | ||
| 'a finding', | ||
| ); | ||
| } | ||
| }); | ||
|
|
||
| it('leaves a footer run alone when text follows it', () => { | ||
| const body = `a finding\n\n${reviewFooter('m', '0.21.3')}\n\na closing line`; | ||
| expect(body.replace(REVIEW_FOOTER_RE, '')).toBe(body); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2026 Qwen Team | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // The attribution footer every posted review carries, stated once. | ||
| // | ||
| // `compose-review` composes it into the verdict body and `submit` strips | ||
| // forged copies before appending the real one to each inline comment — two | ||
| // producers by construction, plus the regex that must match both. They used | ||
| // to be side-by-side template literals with nothing asserting they stayed in | ||
| // step: a wording edit to one leaves the strip regex unable to match the | ||
| // composed footer (duplicates posted) or the summary carrying one version | ||
| // while the comments carry another — the exact attribution skew the startup | ||
| // version stamp exists to eliminate. Same shape as `inline-counts.ts`, which | ||
| // this directory already shares between the same two commands. | ||
|
|
||
| /** The footer naming the reviewing model and the CLI version it ran under. */ | ||
| export function reviewFooter(modelId: string, cliVersion: string): string { | ||
| return `_— ${modelId} via Qwen Code /review (v${cliVersion})_`; | ||
| } | ||
|
|
||
| /** | ||
| * One or more trailing footers, with the whitespace around them. | ||
| * | ||
| * The leading `\s*` sits OUTSIDE the repeated group so each run of | ||
| * whitespace has exactly one owner. With it inside the group, the run | ||
| * between two footers could be split across iterations arbitrarily; when the | ||
| * trailing `$` then failed (a footer run followed by ordinary text — the | ||
| * natural output of a model looping on the same comment) the engine | ||
| * enumerated all those splits before giving up, growing ~27x per footer | ||
| * on the model-authored bodies this regex strips. | ||
| */ | ||
| export const REVIEW_FOOTER_RE = | ||
| /\s*(?:_— [^\n]* via Qwen Code \/review(?: \(v[^\n)]*\))?_\s*)+$/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.