improve and prevent silent thread branch drift and PR fetching#2284
improve and prevent silent thread branch drift and PR fetching#2284justsomelegs wants to merge 17 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces new user-facing behavior: a warning UI when the local checkout branch diverges from the thread branch, with actions to resolve the mismatch. It also modifies PR matching logic for cross-repository scenarios and changes how PR status is resolved for worktree threads. These are non-trivial runtime behavior changes that warrant human review. You can customize Macroscope's approvability policy. Learn more. |
|
Heya I will properly review your PRs when we get back from Miami. Seems like some good stuff just don't have capacity to review big PRs while we're here |
f1ffd01 to
02bb838
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 23355c1. Configure here.
|
either i messed soemthing up when mergin main or i don't understand this PR: CleanShot.2026-05-02.at.23.02.21.mp4 |
e0314cf to
beb7b1a
Compare
|
@justsomelegs is attempting to deploy a commit to the Ping Labs Team on Vercel. A member of the Team first needs to authorize it. |
It meant to warn the user when switching branches that the thread was last working on another branch so that they dont accidently try and continue the work on the wrong branch. just pushed my local version up that is rebased onto main if you wanna try that one out. Screen.Recording.2026-05-04.101354.mp4 |
- Surface mismatch state inside the branch picker - Replace the inline popover with embedded actions and tooltips - Tighten list height when a branch mismatch is shown

What Changed
Improves the local branch mismatch warning in the branch picker.
Why
When using local checkout mode, the active Git branch can drift away from the branch a thread was last associated with. Previously this was easy to miss and could lead to continuing work on the wrong branch.
This makes the mismatch visible in-place and gives users clear recovery actions without changing branches automatically.
The thread’s associated branch should only change when the user intentionally chooses a branch for the thread, creates/checks out a branch through the picker, or clicks
Use currentin the warning popover. It should not change just because the shared local checkout moved while viewing an existing server thread.UI Changes
Screenshots/video to attach:
Use current/Switchactions.Checklist
Note
Fix thread branch drift and improve PR matching for dedicated worktrees
matchesBranchHeadContextin GitManager.ts now correctly rejects cross-repo PR mismatches and tolerates missing GitHub head identity metadata instead of silently drifting.GitActionsControlno longer overwrites an existing server thread's branch from current checkout state when using a shared checkout.resolveThreadPrin ThreadStatusIndicators.tsx returns a PR for dedicated worktrees even when the stored branch name is stale or missing; shared checkouts still scope to the thread branch.BranchToolbarBranchSelectordetects when the local checkout differs from the thread branch and offers actions to either switch the checkout or update the thread.PrStatusTooltipContentcomponent with a bold lead and truncated title.Macroscope summarized 7ecd31d.
Note
Medium Risk
Adjusts git/PR matching and thread-branch persistence logic plus adds new branch-switch actions in the UI; mistakes could cause incorrect PR reuse or unintended branch/thread association changes.
Overview
Prevents silent thread branch drift in local checkout mode by detecting when the stored thread branch differs from the current checkout and surfacing a warning state in the branch picker (highlight + icon + popover), with one-click actions to either switch the checkout back or update the thread to the current branch.
Tightens PR/status correctness across repos and worktrees. Server-side PR reuse now matches head identity more defensively (handling missing GitHub head metadata and rejecting cross-repo vs same-repo mismatches), and web PR indicators are now scoped to the stored thread branch for shared checkouts while allowing dedicated worktree threads to show PR status even if stored branch metadata is stale/missing; tooltips were also restructured via
PrStatusTooltipContent.Adds/updates targeted tests to cover the new PR head-identity matching rules, branch mismatch detection, and avoiding overwriting an existing server thread branch when the shared checkout changes.
Reviewed by Cursor Bugbot for commit d9e44e3. Bugbot is set up for automated code reviews on this repo. Configure here.