Fixes #319255 - Scope Copilot preview policy to Copilot image attachments#322199
Open
sgent-epic wants to merge 4 commits into
Open
Fixes #319255 - Scope Copilot preview policy to Copilot image attachments#322199sgent-epic wants to merge 4 commits into
sgent-epic wants to merge 4 commits into
Conversation
Image attachments are currently marked as unsupported when Copilot editor preview features are disabled, even when the selected model is provided by an extension and advertises vision support. Keep the Copilot preview-feature gate for Copilot-hosted models, but allow extension-contributed providers to rely on their declared vision capability. This lets BYOK language model providers receive image input while preserving the existing Copilot-hosted policy behavior. Add coverage for both attachment pill rendering and prompt rendering, so the UI state and the request payload path stay aligned.
Author
|
@microsoft-github-policy-service agree [Epic Games] |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR scopes the “Copilot preview features disabled” gate to Copilot-hosted models so that extension-contributed (BYOK) language model providers can still receive image attachments based on their declared vision capability. This aligns the chat UI attachment state with the prompt payload behavior for Copilot vs. extension endpoints.
Changes:
- Add a vendor-scoped helper to apply the preview-features-disabled policy only for Copilot models when rendering image attachment pills.
- Update Copilot prompt image rendering to allow extension-contributed endpoints to render image input without requiring Copilot preview features.
- Add tests covering the policy scoping behavior (workbench) and image content-part rendering (Copilot extension).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/attachments/chatAttachmentWidgets.test.ts | Adds unit coverage for preview-feature policy scoping to Copilot vendor models. |
| src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.ts | Introduces vendor-scoped policy check for image attachment pill rendering/hover messaging. |
| extensions/copilot/src/extension/prompts/node/panel/test/image.spec.tsx | Adds vitest coverage for image prompt rendering across Copilot-hosted vs extension-contributed endpoints. |
| extensions/copilot/src/extension/prompts/node/panel/image.tsx | Refactors image rendering gate to allow extension-contributed vision models without Copilot preview features. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Image attachments are currently marked as unsupported when Copilot editor preview features are disabled, even when the selected model is provided by an extension and advertises vision support. Keep the Copilot preview-feature gate for Copilot-hosted models, but allow extension-contributed providers to rely on their declared vision capability. This lets BYOK language model providers receive image input while preserving the existing Copilot-hosted policy behavior. Add coverage for both attachment pill rendering and prompt rendering, so the UI state and the request payload path stay aligned.
Author
|
I am reopening this PR with my employer's (Epic Games) approval. |
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 #319255 - Scope Copilot preview policy to Copilot image attachments
Image attachments are currently marked as unsupported when Copilot editor
preview features are disabled, even when the selected model is provided by
an extension and advertises vision support.
Keep the Copilot preview-feature gate for Copilot-hosted models, but allow
extension-contributed providers to rely on their declared vision capability.
This lets BYOK language model providers receive image input while preserving
the existing Copilot-hosted policy behavior.
Add coverage for both attachment pill rendering and prompt rendering, so the
UI state and the request payload path stay aligned.