Feature request: allow relinking a session to a different Pull Request
- Dominant language
- No language data
- Stars
- 2.1k
- Forks
- 153
- PR merge metrics
- No merged PRs in 30d
Description
Feature request: allow relinking a session to a different Pull Request
We found a gap in the current session/PR integration model.
A session can remain internally linked to an old PR even when the underlying Git branch has been moved, rebased, or intentionally repointed to a different existing PR. In this case, GitHub shows the correct PR for the branch, but the session UI badge and session metadata still point to the previous PR. This creates confusion because the session appears attached to the wrong review context even though the actual branch state is correct.
Requested capability
Please add support for changing the PR linked to an existing session, in two forms:
Manual UI action
A session-level action such as "Change linked PR" or "Relink session to PR"
Allow selecting an existing PR in the same repository
Update the session badge, metadata, and any PR-aware UI surfaces accordingly
Tool/API support
Add a tool/action that allows an agent to update the PR associated with the current session
This is important when the branch is intentionally reused, fast-forwarded, rebased, or moved under a different PR and we want the session context to stay aligned without creating a new session
Why this matters
This is useful when:
a branch is repointed to an existing PR
an incorrect PR was initially associated with the session
a user wants to keep the same session history/worktree but move to the correct PR context
GitHub branch-to-PR state is correct, but the Copilot session metadata is stale
Expected behavior
After relinking:
the session should display the correct PR badge
PR-related UI actions should target the new PR
the old PR association should be fully replaced
no new session should be required
Nice-to-have
validation that the selected PR matches the current repository
warning if the selected PR head branch does not match the current session branch
optional "force relink" behavior for advanced cases
---
| Field | Value |
| --- | --- |
| App version | 1.0.17 |
| OS | Windows 10.0.26200 |
| Theme | GitHub |
| Path | /chat |
| Tenure | Day 6 (Week 1) |
Contributor guide
Research direction
Start by tracing the session/PR integration behind the /chat surface, including the session badge and metadata behavior. Define how the manual relink action and agent tool share the update, then verify that the new PR replaces the old association, PR-aware actions target it, and no new session is created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github
- Domain
- api, developer-experience, full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100