Skip to content

Session gets another session's PR (and title) after shared-checkout branch switch #5528

Open

Description

@alex-morgun-1

App version: GitHub Copilot desktop 1.1.35 (macOS)

Summary

A project session using the repository's shared local checkout (no worktree) silently follows branch changes made in that checkout by unrelated work. The app then auto-links the PR for the new branch to the session, and the session's displayed title switches to that unrelated PR's title. To the user, the session looks like it got renamed using another session's context.

Steps to reproduce

  1. Create a project session (session A) on the repo's shared local checkout (branch mode, not worktree), e.g. on branch feature-a. Let it get an auto-generated name.
  2. Separately (another session or the terminal), check out a new branch feature-b in the same checkout and open a PR from it.
  3. Return to session A.

Expected

Session A keeps its own name and isn't linked to the PR from feature-b.

Actual

  • checkout_branch_sync: Detected shared Local checkout branch change workspace_id=<A> old_branch="feature-a" new_branch=feature-b
  • About 20 min later: external_created_pr_autolink: matched PR workspace_id=<A> pr_number=<N> head="feature-b"
  • Session A now shows PR #N's title instead of its own name. The session's agent never called rename_session, and events.jsonl has no rename before the user noticed.

Notes / suggestions

  • Don't auto-link PRs created from a branch that was switched to outside the session, or ask before linking.
  • Don't let a linked PR title override a session name that was generated or set earlier.
  • If a branch change in a shared checkout is detected, warn in the other sessions that use that checkout.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions