🤖 fix: harden review diff parsing for prefix variants#3040
🤖 fix: harden review diff parsing for prefix variants#3040RainbowDashy wants to merge 6 commits intocoder:mainfrom
Conversation
Teach the diff parser to canonicalize paired git path labels, honor ---/+++ patch headers, and preserve rename metadata so --no-prefix, mnemonic-prefix, add, and delete patches resolve the correct repo-relative paths. Add regression coverage for real git-generated --no-prefix and mnemonic-prefix diffs, and make the deletion test self-contained so it no longer depends on prior test ordering.
Keep the robust diff parser changes intact while addressing the remaining lint complaints by switching the parsed path label shape to an interface and using an optional chain for the null-path guard.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c83ea5e5d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18dd83fbfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4383f8531d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
Summary
Make the Review diff parser tolerate more real-world git patch header formats so the Review tab no longer drops valid diffs when git uses mnemonic prefixes or
--no-prefix.Background
The Review panel parsed file boundaries from
diff --githeaders but assumed path labels always looked likea/...andb/.... In workspaces using mnemonic prefixes such asc/...andw/..., or diffs produced with--no-prefix, Review could show a non-zero raw output size while still reporting zero parsed files and hunks.Implementation
src/common/utils/git/diffParser.tsnow canonicalizes diff path labels more carefully instead of blindly stripping the first path segment. The parser now:--no-prefixis used/dev/nullfor additions and deletionssrc/common/utils/git/diffParser.test.tsadds focused coverage for mnemonic-prefix and--no-prefixdiffs, including add/delete cases.Validation
bun test src/common/utils/git/diffParser.test.tsbun x prettier --check src/common/utils/git/diffParser.ts src/common/utils/git/diffParser.test.tsmake static-checkRisks
Low. The change is narrowly scoped to diff header/path normalization in the shared parser, with regression coverage for the newly supported diff forms.
Generated with
mux• Model:openai:gpt-5.4• Thinking:high• Cost:$0.00