Skip to content

Authenticate MCP servers outside active turns - #326881

Merged
Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/mcp-auth-session-watcher
Jul 21, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/mcp-auth-session-watcher

Conversation

@connor4312

Copy link
Copy Markdown
Member

Summary

  • resolve existing MCP authentication grants from a session-wide watcher
  • keep authentication prompt rendering scoped to active turns
  • deduplicate concurrent silent authentication attempts
  • cover completed background sessions that require MCP authentication

Related to github/copilot-cli#4203.

Testing

  • npm run typecheck-client
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts --grep "mcp auth prompt"
  • npm run valid-layers-check
  • hygiene check on changed files

Copilot AI review requested due to automatic review settings July 21, 2026 20:51
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) July 21, 2026 20:51

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.

Pull request overview

Adds session-wide MCP authentication handling while keeping prompts turn-scoped.

Changes:

  • Watches session state for MCP authentication requirements.
  • Deduplicates in-flight silent authentication attempts.
  • Tests authentication for inactive background sessions.
Show a summary per file
File Description
agentHostSessionHandler.ts Adds session authentication watchers and deduplication.
agentHostChatContribution.test.ts Covers background-session silent authentication.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Medium

@connor4312
Connor Peet (connor4312) merged commit f9b2500 into main Jul 21, 2026
29 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/mcp-auth-session-watcher branch July 21, 2026 21:33
@vs-code-engineering vs-code-engineering Bot added this to the 1.131.0 milestone Jul 21, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 4, 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