claude-code - 💡(How to fix) Fix [BUG] Desktop app PR status bar shows closed/merged PR on main (still reproduces on 2.1.156; #48694 closed without a fix)

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…

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.

Root Cause

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.

Code Example

GET /repos/OWNER/REPO/pulls?head=OWNER:main&state=open

---

# 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
RAW_BUFFERClick to expand / collapse

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

  1. In any repo, have main be the HEAD of at least one PR at some point (for example, a PR merging main into another branch).
  2. Close or merge that PR.
  3. Check out main locally with no open PRs from it.
  4. 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.

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

claude-code - 💡(How to fix) Fix [BUG] Desktop app PR status bar shows closed/merged PR on main (still reproduces on 2.1.156; #48694 closed without a fix)