Repository navigation
Keep the GitHub MCP registry policy when a refresh fails - #344895
Merged
Merged
Conversation
A failed /copilot/mcp_registry refresh (network error, 5xx, malformed response, 401/403/429) no longer drops the organization's MCP registry URL and "registry only" access level. Only a 404 or an empty registry list clears them, matching how managed settings handle failures. Fixes #294710 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to retain cached GitHub MCP registry policy when refreshes fail.
No open issues 🎉
What changed in this PR
This PR keeps VS Code’s last known GitHub MCP registry policy through failed refreshes, extending the retention behavior used for managed settings.
Changes:
- Preserve the cached registry URL, access level, and original timestamp when a refresh fails.
- Treat only HTTP 404 or a successful empty registry response as confirmation to clear the registry policy.
- Add regression coverage for failed refreshes and confirmed policy removal.
| File | Description |
|---|---|
| src/vs/workbench/services/accounts/test/browser/defaultAccount.test.ts | Tests policy and timestamp retention on failures, plus clearing on affirmative responses. |
| src/vs/workbench/services/accounts/browser/defaultAccount.ts | Retains cached registry policy on failures and narrows HTTP-based clearing to 404. |
Review effort: Balanced
Co-authored-by: Copilot <[email protected]>
Ross Wollman (rwoll)
enabled auto-merge (squash)
October 29, 2026 05:10
Joaquín Ruales (jruales)
approved these changes
Oct 29, 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.
Fixes #294710
Problem
When an organization or enterprise sets MCP access to registry only in its GitHub Copilot policies, VS Code learns about it from
/copilot/mcp_registry. If a refresh of that endpoint failed, VS Code dropped the restriction and MCP access became unrestricted until a later refresh succeeded:Change
Keep the last known registry policy unless GitHub clearly says it changed. This is the same rule that #337583 applies to managed settings.
ChatMCPdevice policy, or GitHub managed settings withforceRemoteSettingsRefresh.Affected settings and policies
chat.mcp.access(policyChatMCP): the GitHub "registry only" value no longer disappears after a failed refresh.chat.mcp.gallery.serviceUrl(policyMcpGalleryServiceUrl): the registry URL from GitHub is kept the same way.allowedMcpServers/deniedMcpServersmanaged settings, which already keep the last good value since managed settings: keep policy through transient refresh failures #337583.Testing
Added a unit test to
defaultAccount.test.ts. It checks that failed refreshes keep the registry policy and its original timestamp, and that a 404 or an empty registry list clears it. The test fails without this change.