Skip to content

fix(ui): keep PR bars visible after checkout changes - #147166

Merged
steipete merged 1 commit into
mainfrom
codex/fix-session-pr-bars
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-session-pr-bars

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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

  • The regression fails on the original code and passes after the fix. Read-only live investigation confirmed the detached checkout and retained PR links in the transcript index.
  • 59 focused PR discovery/cache tests passed, including new references during rate-limit backoff, reference/API failures, and same-name fork branches. Indexed transcript, reset, reader compatibility, and UI state tests also passed.
  • Two bundled browser E2E cases passed. Core, test, and UI typechecks, changed-file lint, formatting, and the selected repository guards passed. Independent review completed with no accepted P0–P2 findings.

Synthetic Control UI boundary proof before and after PR discovery:

Before After
Before: composer without PR bars After: open and merged PR bars above the composer

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.
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete steipete self-assigned this Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 15:58
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:07 PM ET / 16:07 UTC.

ClawSweeper review

What this changes

Keeps 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
Reviewed head: 719aa5c4ca8e44a41b2d2636e51e34b638926395

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage, inspected visual evidence, and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.
Evidence reviewed 8 items Current main still has the reported mechanism: The fetched main implementation returns null for detached HEAD before reading the GitHub remote. Its PR loader also returns an empty list on the default branch.
Bounded discovery uses the existing transcript owners: Reference discovery selects up to 25 recent assistant matches from the current session generation, hydrates at most 128 KiB through the canonical current-history reader, accepts at most three same-repository PR numbers, and rechecks session identity afterward. This path does not depend on the Codex harness.
Publication eligibility remains separate from references: Only exact working-branch lookup results contribute live-PR and merged-head facts. Referenced PRs supply display chips, while the UI consumes the Gateway’s branch decision instead of duplicating it.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +304, Tests +410, Docs 0. Total +714 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 10 411 107 +304
Tests 6 451 41 +410
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 863 149 +714

Review metrics

Metric Value Why it matters
Discovery bounds 25 candidate messages; 128 KiB hydration; 3 referenced PRs Explicit limits constrain transcript work and additional GitHub lookups during watched-session polling.
Production versus test growth production +304 net lines; tests +410 net lines Production growth supports bounded reference discovery and cache recovery, with regression coverage for visibility and publication separation.

Technical review

Best 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.

Labels

Label changes:

  • add P2: Repairs disappearing PR status indicators during review and landing workflows without evidence of a broader runtime outage.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.

Label justifications:

  • P2: Repairs disappearing PR status indicators during review and landing workflows without evidence of a broader runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The maintainer-authored PR is exempt from the external-contributor proof gate. Inspected synthetic screenshots show chip rendering after snapshot delivery; they do not independently prove the Gateway’s GitHub discovery path.

Evidence

What I checked:

  • Current main still has the reported mechanism: The fetched main implementation returns null for detached HEAD before reading the GitHub remote. Its PR loader also returns an empty list on the default branch. (src/gateway/control-ui-session-prs-git.runtime.ts:12, ca0746ad8c56)
  • Bounded discovery uses the existing transcript owners: Reference discovery selects up to 25 recent assistant matches from the current session generation, hydrates at most 128 KiB through the canonical current-history reader, accepts at most three same-repository PR numbers, and rechecks session identity afterward. This path does not depend on the Codex harness. (src/gateway/control-ui-session-pr-references.ts:44, 719aa5c4ca8e)
  • Publication eligibility remains separate from references: Only exact working-branch lookup results contribute live-PR and merged-head facts. Referenced PRs supply display chips, while the UI consumes the Gateway’s branch decision instead of duplicating it. (src/gateway/control-ui-session-prs.ts:438, 719aa5c4ca8e)
  • Focused regression coverage: Inspected tests cover detached/default checkout discovery, reset-hidden links, generation changes during hydration, byte limits, same-name fork branches, unrelated merged references, and quota backoff. The body reports passing focused tests and typechecks; this read-only review did not execute them. (src/gateway/control-ui-session-prs-branch.test.ts:192, 719aa5c4ca8e)
  • Prepared screenshots inspected: Both downloaded images were inspected: the first shows the composer without PR chips; the second shows open and merged chips above it. The captured body explicitly identifies these as synthetic Control UI boundary proof. The E2E scenario injects a PR snapshot, so these images establish rendering rather than real GitHub discovery. (ui/src/e2e/chat-pull-requests.e2e.test.ts:147, 719aa5c4ca8e)
  • Main-history routing: Main history repeatedly records Peter Steinberger on PR discovery, caching, transcript lookup, and publication work. Exact line attribution could not be completed because an older blob was unavailable; no introduction claim is made. (src/gateway/control-ui-session-prs.ts, f0fafba02efd)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit a289914 into main Sep 13, 2026
266 checks passed
@steipete
steipete deleted the codex/fix-session-pr-bars branch September 13, 2026 16:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant