Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

api: support requestInitiator as undefined in LanguageModelAccess - #4119

Merged
Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/290436-prep
Mar 3, 2026
Merged

api: support requestInitiator as undefined in LanguageModelAccess#4119
Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/290436-prep

Conversation

@connor4312

Copy link
Copy Markdown
Member

api: support requestInitiator as undefined in LanguageModelAccess

Aligns with the vscode.proposed.chatProvider API change where requestInitiator
is now 'string | undefined' instead of just 'string'. The change represents that
'core' (editor-initiated requests) are now communicated as undefined rather than
the 'core' string.

  • Updates CopilotLanguageModelWrapper to accept extensionId as 'string | undefined'
    in both _provideLanguageModelResponse and provideLanguageModelResponse methods
  • Changes comparisons from 'extensionId === "core"' to '!extensionId'
    to handle the new undefined case
  • Updates blocked extension check to guard against undefined extensionId
  • Updates telemetry to keep extensionId as undefined internally
  • Brings vscode.proposed.chatProvider.d.ts to version 5

Relates to microsoft/vscode#298767

(Commit message generated by Copilot)

Copilot AI review requested due to automatic review settings March 2, 2026 18:58
@vs-code-engineering vs-code-engineering Bot added this to the March 2026 milestone Mar 2, 2026

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

Updates the extension’s proposed VS Code typings and request handling to support the upstream API change where requestInitiator can be undefined for editor-initiated language model requests (previously communicated as the "core" string).

Changes:

  • Updates ProvideLanguageModelChatResponseOptions.requestInitiator to string | undefined.
  • Adjusts CopilotLanguageModelWrapper to accept extensionId: string | undefined and treat editor-initiated requests as undefined (including normalizing legacy "core").
  • Guards blocked-extension logic and request metadata/header behavior to handle undefined initiators.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
src/extension/vscode.proposed.chatProvider.d.ts Updates proposed API typings for requestInitiator to allow undefined.
src/extension/conversation/vscode-node/languageModelAccess.ts Propagates undefined initiator through LM wrapper logic; replaces "core" checks with undefined-aware logic and guards blocked-extension handling.

Aligns with the vscode.proposed.chatProvider API change where requestInitiator
is now 'string | undefined' instead of just 'string'.  The change represents that
'core' (editor-initiated requests) are now communicated as undefined rather than
the 'core' string.

- Updates CopilotLanguageModelWrapper to accept extensionId as 'string | undefined'
  in both _provideLanguageModelResponse and provideLanguageModelResponse methods
- Changes comparisons from 'extensionId === "core"' to '!extensionId'
  to handle the new undefined case
- Updates blocked extension check to guard against undefined extensionId
- Updates telemetry to keep extensionId as undefined internally
- Brings vscode.proposed.chatProvider.d.ts to version 5

Relates to microsoft/vscode#298767

(Commit message generated by Copilot)
@connor4312
Connor Peet (connor4312) added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 234d02c Mar 3, 2026
19 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/290436-prep branch March 3, 2026 00:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants