Skip to content

feat: updates for Copilot CLI to include mode instructions#303962

Merged
DonJayamanne merged 8 commits intomainfrom
don/neutral-mollusk
Mar 24, 2026
Merged

feat: updates for Copilot CLI to include mode instructions#303962
DonJayamanne merged 8 commits intomainfrom
don/neutral-mollusk

Conversation

@DonJayamanne
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 23, 2026 05:51
@DonJayamanne DonJayamanne self-assigned this Mar 23, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 23, 2026
@github-actions

This comment was marked as outdated.

Copy link
Contributor

Copilot AI left a comment

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 extends the chat/session plumbing to carry “mode instructions” through Copilot CLI (and other contributed session) request history, so the UI can rehydrate picker state (mode/agent + model) based on prior requests.

Changes:

  • Bumps chatParticipantPrivate proposed API version and adds modeInstructions2 to ChatRequestTurn2.
  • Threads modeInstructions through chat session history DTOs and ext host/main thread converters, with added unit tests.
  • Introduces an extension-point flag useRequestToPopulateBuiltInPickers and uses it during remote session restoration / input picker preselection.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts Proposed API version bump + modeInstructions2 added to ChatRequestTurn2.
src/vs/platform/extensions/common/extensionsApiProposals.ts Updates proposal version to match the d.ts bump.
src/vs/workbench/contrib/chat/common/chatSessionsService.ts Adds modeInstructions to session history items + new extension point flag.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Adds useRequestToPopulateBuiltInPickers to extension point schema.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Restores picker state from remote session history; persists modeInstructions into history export.
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Adjusts picker preselection logic and sets mode from last request’s mode instructions (when applicable).
src/vs/workbench/contrib/chat/common/model/chatModel.ts Minor formatting change in addRequest response model creation.
src/vs/workbench/api/common/extHostTypes.ts Ext host ChatRequestTurn now carries modeInstructions2.
src/vs/workbench/api/common/extHostTypeConverters.ts Adds converters for ChatRequestModeInstructions (including Dto handling) + reverse conversion.
src/vs/workbench/api/common/extHostChatSessions.ts Passes mode instructions into/out of ChatRequestTurn.
src/vs/workbench/api/common/extHostChatAgents2.ts Includes modeInstructions2 when exposing request turns to extensions (gated by proposal).
src/vs/workbench/api/common/extHost.protocol.ts Adds modeInstructions to the session history DTO.
src/vs/workbench/api/browser/mainThreadChatSessions.ts Revives mode instructions from history + forwards them in fork DTOs.
src/vs/workbench/api/test/common/extHostTypeConverters.test.ts Adds unit tests for mode-instructions conversion roundtrips and DTO revival.
src/vs/workbench/api/test/browser/mainThreadChatSessions.test.ts Adds tests for mode-instructions revival and DTO pass-through.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts:616

  • findLast(providedSession.history.filter(...)) allocates filtered arrays and then scans again. Since this runs on remote session load and history can be large, consider scanning once from the end of providedSession.history (or using findLast directly on the full history with a predicate that checks type === 'request') to avoid extra allocations and passes.
		const modelId = findLast(providedSession.history.filter(m => m.type === 'request'), req => req.modelId)?.modelId;
		const agentUri = findLast(providedSession.history.filter(m => m.type === 'request'), req => req.modeInstructions?.uri)?.modeInstructions?.uri;
		let initialData: ISerializedChatDataReference | undefined = undefined;

DonJayamanne and others added 3 commits March 24, 2026 13:41
…s.contribution.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.

@DonJayamanne DonJayamanne marked this pull request as ready for review March 24, 2026 04:08
@DonJayamanne DonJayamanne merged commit cdf4f2f into main Mar 24, 2026
24 checks passed
@DonJayamanne DonJayamanne deleted the don/neutral-mollusk branch March 24, 2026 04:08
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.

3 participants