agentHost: preserve static MCP OAuth client IDs - #334135
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The narrowly scoped OAuth propagation changes are consistent and covered by targeted regression tests.
Review tier: Balanced
Findings: None
What changed in this PR
Preserves static MCP OAuth client IDs through Agent Host normalization, SDK conversion, and authentication handling.
Changes:
- Normalizes VS Code and SDK OAuth client-ID formats.
- Forwards client IDs to the Copilot SDK.
- Correctly prioritizes secrets and defaults ID-only clients to public.
| File | Description |
|---|---|
pluginParsers.test.ts |
Tests both OAuth input formats. |
pluginParsers.ts |
Normalizes OAuth client IDs. |
copilotPluginConverters.test.ts |
Tests SDK conversion. |
copilotAgentSession.test.ts |
Covers secret priority and public default. |
copilotPluginConverters.ts |
Forwards oauthClientId. |
copilotAgentSession.ts |
Corrects static-client selection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Paul (pwang347)
marked this pull request as ready for review
September 2, 2026 22:37
Paul (pwang347)
enabled auto-merge (squash)
September 2, 2026 22:37
Connor Peet (connor4312)
approved these changes
Sep 2, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #328347.
Problem
Agent Host reconstructs workspace and plugin MCP server configuration before handing it to the Copilot SDK. The current path:
oauth.clientIdand SDK-styleoauthClientIdduring workspace normalization;toSdkMcpServer; andstaticClientConfigunlesspublicClientis explicitlytrue.For servers such as Slack that require a pre-registered client and do not support Dynamic Client Registration, the runtime consequently receives no client ID. VS Code falls back to DCR and prompts the user to manually provide client registration details.
Fix
oauth.clientIdrepresentation.oauthClientId.publicClientis omitted, matching the runtime public-client default.clientSecrettake priority overpublicClient, and cover that behavior with a regression test requested on Preserve static MCP OAuth client id in agent host #328347.Validation
npm run typecheck-client./scripts/test.sh --grep "pluginParsers|copilotPluginConverters"(99 passing)./scripts/test.sh --grep "CopilotAgentSession MCP server inventory"(27 passing)npm run precommit