Skip to content

[1/4] authentication: refresh Copilot on session issuer changes - #338149

Merged
TylerLeonhardt merged 4 commits into
mainfrom
tyleonha/ghe-stack-1-copilot-identity
Sep 27, 2026
Merged

TylerLeonhardt merged 4 commits into
mainfrom
tyleonha/ghe-stack-1-copilot-identity

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Review stack

#338149 (1: Copilot identity) → #338150 (2: provider lifecycle) → #338151 (3: credential storage) → #338080 (4: multi-host enablement)

Each PR targets the preceding branch. Review and merge in numbered order. After squash-merging a layer, rebase and retarget the next layer onto main before merging it.

Stack 1/4: Copilot identity refresh

Base: main.

Review question

Does changing a GitHub session's account or authorization server refresh Copilot authentication and identity-dependent repository state, even when its token and session ID are unchanged?

  • Reuse the existing account/issuer comparison when publishing authentication changes.
  • Update the code-search subscriber to invalidate repository authorization/index status for the same identity changes, while preserving existing session-ID invalidation.
  • Avoid redundant repository refreshes for token-only changes or equivalent session objects.

This is an independent bug fix using the session-provenance API already on main. It adds service and subscriber regressions without changing providers, configuration, credential storage, or enrollment.

Validation

  • 48 targeted authentication/session/code-search tests passing; 1 existing skip.
  • Four same-ID account/issuer cases reproduced stale repository status before the subscriber fix; all nine subscriber tests pass afterward.
  • Copilot type check, scoped lint, staged hygiene and diff check passed.
  • Full-stack follow-up: 105 authentication/code-search/domain/MCP tests passing, 1 existing skip.

The next layer (#338150) separates enterprise registration from host-bound engines while keeping current single-host behavior.

Screenshot CI follow-up

The earlier one-time screenshot override was explicitly approved by the maintainer, who reported that its two-pixel difference was not noticeable to their human eye. After rebasing onto the newer upstream fixture code, both captures in run 36328148644 matched the original upstream baseline instead. Commit fc3e05b83c2 removes the now-obsolete override; this PR no longer changes screenshot baselines.

The new Playwright fixture tests initially hit render timeouts, but all 75 passed on an unchanged-head retry. No fixture implementation, UI, timeout threshold or authentication code was changed for this CI repair. Final fixture CI passed: all 75 Playwright tests, Screenshots, and Screenshots & Tests succeeded on run 36334957548 attempt 2. This PR merged on 2026-09-27.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Identity-only changes violate the legacy access-token event contract and leave code-search status stale.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Refreshes Copilot authentication when a GitHub session’s account or issuer changes without an access-token change.

Changes:

  • Compares complete session identity during authentication refresh.
  • Adds an issuer-only regression test.
File Description
authentication.ts Detects account and issuer identity changes.
session.spec.ts Tests issuer-only authentication refresh.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Base: 4336606a Current: afe7ec3c

No screenshot changes.

@TylerLeonhardt
TylerLeonhardt marked this pull request as ready for review September 27, 2026 05:55
@TylerLeonhardt
TylerLeonhardt enabled auto-merge (rebase) September 27, 2026 05:55
TylerLeonhardt and others added 3 commits September 27, 2026 08:03
Detect issuer or account identity changes even when the access token is unchanged, and notify consumers after refreshing Copilot state.

Co-authored-by: Copilot <[email protected]>
Use the shared account/issuer identity comparison in the code-search subscriber while retaining session-ID invalidation and token-refresh suppression. Test real repository status refreshes for both session kinds when an issuer or account changes without a new session ID.

Co-authored-by: Copilot <[email protected]>
Accept the CI-captured DarkHighContrast baseline for SessionsList_SelectedKeyboardFocus as a one-time maintainer-approved update. The maintainer reports that the visual difference is not noticeable to their eye. No UI or fixture implementation changes.

Co-authored-by: Copilot <[email protected]>
@TylerLeonhardt
TylerLeonhardt force-pushed the tyleonha/ghe-stack-1-copilot-identity branch from c65c3e0 to 6444d0c Compare September 27, 2026 15:03
Both captures after the upstream fixture rebase match the original main baseline. Remove the one-time, visually imperceptible override so the authentication PR no longer changes screenshot expectations. Playwright fixture tests passed on the unchanged-head retry.

Co-authored-by: Copilot <[email protected]>
@TylerLeonhardt
TylerLeonhardt merged commit 987bbdd into main Sep 27, 2026
36 of 38 checks passed
@TylerLeonhardt
TylerLeonhardt deleted the tyleonha/ghe-stack-1-copilot-identity branch September 27, 2026 17:23
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 27, 2026

@alotibiamo4-alt alotibiamo4-alt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying

@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants