codex - 💡(How to fix) Fix Desktop Git panel compares branch changes against the default branch instead of the PR base

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

Current branch: feature/...
Detected PR in Codex Git panel: PR #596
Actual GitHub PR base branch: dev
Actual GitHub PR head branch: feature/...

---

git diff --shortstat origin/dev...HEAD
61 files changed, 1453 insertions(+), 552 deletions(-)

---

+59 878 -8 370

---

git diff --shortstat origin/main...HEAD
657 files changed, 59878 insertions(+), 8370 deletions(-)

---

git diff --shortstat origin/dev...HEAD

---

git diff --shortstat origin/main...HEAD

---

+1453 -552

---

+59878 -8370

---

feature/* -> dev -> preprod/release -> main
RAW_BUFFERClick to expand / collapse

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?

  1. Use a repository where the GitHub default branch is main.
  2. Use a workflow where feature branches open PRs against dev or develop, not main.
  3. Check out a feature branch that has an open GitHub PR targeting dev.
  4. Open the Codex Desktop Git panel.
  5. Confirm that the panel detects the PR.
  6. Compare the displayed Changes count 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Desktop Git panel compares branch changes against the default branch instead of the PR base