fix(web): keep linked PR handoffs in current thread - #9079
t3-code[bot] wants to merge 2 commits into
Conversation
Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 93780c5. Configure here.
Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused web bug fix that preserves strict repository and PR-number matching while keeping explicitly linked PR handoffs in the current thread after project changes. The affected routing logic is small and covered by targeted regression tests, with no schema, infrastructure, security, billing, or default-setting changes. You can add or adjust custom eligibility rules. Learn more. |
|
Closing as superseded by #12320, which is now merged and keeps PR panel actions (fix checks, findings, resolve conflicts, ask/explain, selected-code notes) in the current thread via full link-list context. |
|
Closing as superseded by #12320. |

summary
verification
request provenance
Note
Medium Risk
Changes ownership rules for PR panel context and composer routing; scoped to explicit links with strict repo/number checks, with regression tests added.
Overview
Fixes PR panel thread vs page context when a thread has an explicit persisted PR link but the live project id no longer matches the open right-panel surface (e.g. project recreated or remapped).
Adds
pullRequestOwnershipCandidateto prefer the linked identity while inferred detail is missing, and extendsisThreadOwnPullRequestwithexplicitlyLinked: match still requires the same repository and number, but project id is only required for inferred ownership—not for an explicit link.ChatViewwires the detail panel through that helper (inferred repo now usesactiveProjectRepository). When ownership resolves to thread, agent handoffs keep the current composer target and in-thread labels instead of opening a separate thread.Reviewed by Cursor Bugbot for commit c5a4bf4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix linked PR handoffs to stay in current thread across project changes
pullRequestOwnershipCandidateto choose between a persisted linked PR identity and an inferred one, tagging the result withexplicitlyLinkedisThreadOwnPullRequestto acceptexplicitlyLinkedand return true when repository and number match, even ifprojectIddiffers from the panel surfaceChatViewContentnow feeds both linked and inferred sources into ownership resolution viapullRequestOwnershipCandidate, soPullRequestDetailPanel.contextevaluates to'thread'when an explicit link existsisThreadOwnPullRequestno longer requiresprojectIdmatch for explicitly linked threads; callers that assumed a matchingprojectIdalways accompanies ownership may see different results in pullRequestDetail.logic.tsMacroscope summarized c5a4bf4.