Skip to content

Fixes #319255 - Scope Copilot preview policy to Copilot image attachments#322199

Open
sgent-epic wants to merge 4 commits into
microsoft:mainfrom
sgent-epic:fix/scope-copilot-preview-image-attachments
Open

Fixes #319255 - Scope Copilot preview policy to Copilot image attachments#322199
sgent-epic wants to merge 4 commits into
microsoft:mainfrom
sgent-epic:fix/scope-copilot-preview-image-attachments

Conversation

@sgent-epic

Copy link
Copy Markdown

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.

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.
Copilot AI review requested due to automatic review settings June 20, 2026 04:38
@sgent-epic

sgent-epic commented Jun 20, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [Epic Games]

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

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.

Comment thread extensions/copilot/src/extension/prompts/node/panel/test/image.spec.tsx Outdated
sgent-epic and others added 3 commits June 20, 2026 08:29
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.
@sgent-epic sgent-epic closed this Jun 20, 2026
@sgent-epic sgent-epic reopened this Jun 23, 2026
@sgent-epic

Copy link
Copy Markdown
Author

I am reopening this PR with my employer's (Epic Games) approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Endpoint vision attachments stop working when using BYOK without GitHub sign-in

4 participants