Desktop Git panel compares branch changes against the default branch instead of the PR base
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.513.31313 (2867)
What subscription do you have?
Pro
What platform is your computer?
macOS, Codex Desktop.
What issue are you seeing?
The Codex Desktop Git panel appears to compute the Changes count against the repository default branch instead of the actual base branch of the detected GitHub pull request.
This is misleading for repositories where feature PRs normally target a non-default integration branch such as dev/develop, while the repository default branch remains main.
Observed on a clean local worktree:
Current branch: feature/...
Detected PR in Codex Git panel: PR #596
Actual GitHub PR base branch: dev
Actual GitHub PR head branch: feature/...
GitHub PR metadata and local Git both agree that the PR diff is small:
git diff --shortstat origin/dev...HEAD
61 files changed, 1453 insertions(+), 552 deletions(-)
However, the Codex Desktop Git panel shows:
+59 878 -8 370
That number exactly matches a comparison against the default/release branch instead of the PR base:
git diff --shortstat origin/main...HEAD
657 files changed, 59878 insertions(+), 8370 deletions(-)
The worktree was clean and synced when this was checked. The branch had an open PR detected by the panel, but the panel's displayed changes did not use the PR base branch.
What steps can reproduce the bug?
- Use a repository where the GitHub default branch is
main. - Use a workflow where feature branches open PRs against
devordevelop, notmain. - Check out a feature branch that has an open GitHub PR targeting
dev. - Open the Codex Desktop Git panel.
- Confirm that the panel detects the PR.
- Compare the displayed
Changescount with:
git diff --shortstat origin/dev...HEAD
and:
git diff --shortstat origin/main...HEAD
What is the expected behavior?
When Codex Desktop detects an associated GitHub PR, the Git panel should compute displayed changes against the PR base branch / base SHA, not blindly against the repository default branch.
For the example above, the panel should display approximately:
+1453 -552
not:
+59878 -8370
If no PR is associated, Codex could fall back to the repository default branch, but once a PR is known, the PR baseRefName should be the source of truth.
Additional information
This creates confusion for teams using GitFlow-like workflows such as:
feature/* -> dev -> preprod/release -> main
In those workflows, main may intentionally lag behind dev, so comparing a feature branch against main can include a large amount of unrelated historical work.
A possible fix would be:
- If the current branch maps to an open PR, use the PR base ref/SHA for the Git panel diff.
- Otherwise, allow a configurable preferred comparison branch per workspace/repo, or fall back to the repository default branch only when no better context exists.