Uh oh!
There was an error while loading. Please reload this page.
fix(pull-requests): shared state + not settling? - #9332
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The change spans server settlement orchestration and multiple client state surfaces, adding automatic merge-triggered settlement and persisted pull-request relinking. These cross-component runtime and user-visible behavior changes have a broader blast radius than an auto-approvable bug fix or bounded option. You can add or adjust custom eligibility rules. Learn more. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1910535. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.

Note
Written by
gpt-5.6-solon behalf of MariaThreads could wait behind the one-minute settlement sweep and two-minute pull request cache, while transient host failures could hide a merged state already observed by the app. This sends successful in-app merges directly to settlement and safely reuses only immutable merged observations. The PR panel and both sidebar implementations now share the newest per-PR state, so a merge reaches every visible surface before paint without a second request. When that branch later exposes a different open pull request, the terminal thread link is replaced and the open panel follows it immediately. Verified with 110 focused server tests, 34 directly affected web tests, server and web typechecks, and repository-pinned formatting and lint; implemented by
gpt-5.6-solin the Codex harness.Note
Medium Risk
Changes auto-settlement timing, PR summary caching semantics, and cross-view client state; bounded merge-event PubSub can drop events under load, and merged observations are sticky for up to five minutes on the client.
Overview
Merges performed in-app now trigger thread settlement right away instead of waiting on the periodic sweep.
PullRequestServiceemits merge events after a successful merge action, andThreadSettlementReactorlistens and runs a sweep scoped to threads linked to that PR—treating the event as merged state without another host lookup.Strict settlement reads (
recoverTransientFailure: false) can return a previously observed merged summary from cache instead of refreshing from the provider, so transient API failures do not undo a merge the app already knows about.On the web, per-PR observed summaries are stored and merged across the PR panel and sidebar via
useSharedPullRequestSummary, with rules that favor merged state and newerupdatedAtso UI surfaces agree after a merge.threadPullRequestRefreshSourceand linked-detail refresh from the panel are removed in favor of this shared state and simpler VCS refresh when the thread PR is inferred, not persisted.Chat can relink a thread from a merged/closed linked PR to a different open PR on the same branch (persisted metadata + open panel), and skips panel
onStateChangecallbacks when a linked PR is already authoritative.Reviewed by Cursor Bugbot for commit 62fe971. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add shared pull-request state and merge-triggered settlement sweeps
PullRequestServicepublishes successful merge events to a bounded PubSub channel and strict summary reads reuse an already-observed merged result instead of refreshing the providerThreadSettlementReactorsubscribes to merge events and runs a targeted sweep that settles only the matching linked thread using the event timestamp, bypassing the periodic schedule and summary lookupsobservedPullRequestSummaryAtom,newestPullRequestSummary, anduseSharedPullRequestSummaryso linked-thread status and the detail panel reflect the newest or merged-precedent summary across componentsChatViewcan display and persist a different open pull request on the same branch when the persisted link is merged or closed, with serialized metadata writes per threadthreadPullRequestRefreshSourceutility and narrowsPullRequestDetailPanel.onStateChangeto{ repository, number, state }PullRequestDetailPanel.onStateChangepayload dropsprojectanddraftfields — any out-of-tree consumer expecting those fields will break; merge-event PubSub has capacity 64 so bursts beyond that drop events and fall back to the periodic sweepMacroscope summarized 62fe971.