Repository navigation
fix(ui): keep PR bars visible after checkout changes - #147166
Conversation
Recover same-repository PR links from indexed assistant replies when review or landing work detaches a checkout or returns it to main. Keep publication eligibility with the Gateway exact-branch lookup and preserve proven PR state through reference failures and quota backoff.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:07 PM ET / 16:07 UTC. ClawSweeper reviewWhat this changesKeeps session PR bars discoverable across checkout changes by combining working-branch discovery with bounded searches of same-repository links in assistant replies. Merge readiness✅ Ready for maintainer review The fix remains useful: current main still loses PR discovery on detached or default-branch checkouts. No blocking introduced defect was found, and this maintainer-owned PR should remain in the normal review flow. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway discovers GitHub PRs for watched sessions and sends shared snapshots to the Control UI’s chat and sidebar. Checkout identity and visible transcript links feed discovery; exact working-branch results separately determine whether to show publication controls. flowchart LR
A[Session checkout] --> C[Gateway PR discovery]
B[Visible assistant replies] --> D[Bounded link search]
D --> C
E[GitHub PR status] --> C
C --> F[Chat and sidebar PR bars]
C --> G[Working-branch publication row]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +304, Tests +410, Docs 0. Total +714 across 17 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain one Gateway-owned PR snapshot that recovers visible conversation references while keeping publication eligibility tied to the actual working branch. Do we have a high-confidence way to reproduce the issue? Yes, from source: detaching a GitHub session checkout makes current main discard its repository context, while returning to the default branch explicitly produces no PRs. This review did not execute a runtime reproduction. Is this the best way to solve the issue? Yes. The patch extends existing discovery and transcript readers, bounds the added work, and removes the UI’s competing publication-row decision without changing stored schemas or settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ca0746ad8c56. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Recover same-repository PR links from indexed assistant replies when review or landing work detaches a checkout or returns it to main. Keep publication eligibility with the Gateway exact-branch lookup and preserve proven PR state through reference failures and quota backoff.
What Problem This Solves
Fixes PR bars and sidebar indicators disappearing when review or landing work detaches a session checkout, returns it to the default branch, or creates a follow-up PR in another worktree.
User Impact
Sessions can recover their linked PRs on a fresh page load and keep their status visible through checkout changes and temporary GitHub failures. No configuration or schema change is required.
Why This Change Was Made
Branch-only discovery discarded the repository when HEAD was detached. The Gateway now combines branch discovery with same-repository PR links from indexed, currently visible assistant replies. Searches and hydration are bounded, and reset-hidden messages stay excluded. The Gateway's exact branch lookup also owns publication-row eligibility, so referenced PRs cannot authorize or suppress publication by merely sharing a branch name.
Evidence
Synthetic Control UI boundary proof before and after PR discovery: