Add version validation check to getContextProviderAPI method by denizguney · Pull Request #339523 · microsoft/vscode · GitHub
Skip to content

Add version validation check to getContextProviderAPI method - #339523

Merged
Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
denizguney:patch-51
Oct 13, 2026
Merged

Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
denizguney:patch-51

Conversation

@denizguney

Copy link
Copy Markdown
Contributor

Fixes #339522

  • Add explicit runtime validation for version parameter in getContextProviderAPI.
  • Throw an informative error on unsupported API versions to improve robustness and future-proofing.

- Add explicit runtime validation for version parameter in getContextProviderAPI.
- Throw an informative error on unsupported API versions to improve robustness and future-proofing.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 23:39

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

🟢 Approval recommended

The focused validation correctly implements the requested safeguard without affecting supported callers.

Review effort: Balanced
Findings: None

What changed in this PR

Adds runtime validation for Copilot context-provider API versions, preventing unsupported versions from silently receiving the v1 implementation.

Changes:

  • Validates that the requested version is 'v1'.
  • Throws an informative error for unsupported versions.
File Description
extensions/​copilot/​src/​extension/​api/​vscode/​extensionApi.ts Adds context-provider API version validation.

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

@spacexm406-web spacexm406-web 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.

Improve and expand daily
Safety Measures

@spacexm406-web spacexm406-web 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.

Improve and Expand Daily
Safety measures

@dbaeumer
Dirk Bäumer (dbaeumer) merged commit 2e150f9 into microsoft:main Oct 13, 2026
35 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add version validation check in CopilotExtensionApi.getContextProviderAPI

8 participants