[BUG] Desktop app PR status bar shows closed/merged PR on main (still reproduces on 2.1.156; #48694 closed without a fix)
Summary
This is a continuation of #48694, which was closed as "completed" on 2026-05-12 but never actually fixed. The bug still reproduces on Claude Code 2.1.156. #48694 itself flags the same premature-closure pattern as #24834 (closed as completed, with no linked commit/PR and no CHANGELOG entry). I'm the original reporter and don't have permission to reopen #48694, so I'm filing this so it can be re-triaged.
What's wrong
In the desktop app (local agent mode), the footer / PR status bar displays a stale non-open PR while on main with zero open PRs.
The app queries the GitHub REST API for PRs with head={owner}:main using state=all, then displays the most recently created result regardless of its state. So it surfaces a closed or merged PR that has nothing to do with the current working state.
A telling detail: the displayed PR is simply whichever head=main PR was created most recently. In #48694 the original screenshot showed a merged PR from months earlier; after some unrelated head=main PRs were later created, the footer now shows a closed, unmerged PR instead. Same bug, different stale PR, which confirms the footer keys purely on "most recent PR with head=main," not on any notion of an active or open PR.
What should happen
The query should filter to open PRs:
GET /repos/OWNER/REPO/pulls?head=OWNER:main&state=open
If there is no open PR for the current branch, the footer should show no PR indicator at all.
Verification
# What the app currently does (state=all): returns a stale closed PR
$ gh api 'repos/OWNER/REPO/pulls?head=OWNER:main&state=all&per_page=1' \
--jq '.[0] | {state, merged_at}'
{"state":"closed","merged_at":null}
# Proposed fix (state=open): correctly returns nothing
$ gh api 'repos/OWNER/REPO/pulls?head=OWNER:main&state=open&per_page=1' \
--jq 'length'
0
Steps to reproduce
- In any repo, have
mainbe the HEAD of at least one PR at some point (for example, a PR mergingmaininto another branch). - Close or merge that PR.
- Check out
mainlocally with no open PRs from it. - Open the desktop app on that repo. The footer shows the stale closed/merged PR.
Version
Claude Code 2.1.156 (originally filed against 2.1.109 in #48694).
Platform
Desktop app, macOS.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗