Display last used model info for Copilot CLI on chat panel #311769
Merged
anthonykim1 merged 8 commits intomainfrom Apr 22, 2026
Merged
Display last used model info for Copilot CLI on chat panel #311769anthonykim1 merged 8 commits intomainfrom
anthonykim1 merged 8 commits intomainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures Copilot CLI sessions can display the “last used model” footer/badge reliably by preserving ChatResult.details through the contributed-session “untitled → real session” swap and subsequent history replay/rebuild paths.
Changes:
- Extend chat session history (and DTO/protocol plumbing) to carry optional
detailson response turns. - Restore
detailsonto the response model when VS Code rebuilds a contributed session from history. - Teach Copilot CLI session reconstruction to attach model details to the final rebuilt response, and add/adjust tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/chatSessionsService.ts | Adds details?: string to response history items. |
| src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts | Applies replayed details onto the last request’s response result during session load. |
| src/vs/workbench/api/common/extHostChatSessions.ts | Serializes response-turn result.details into the session history DTO. |
| src/vs/workbench/api/common/extHost.protocol.ts | Extends IChatSessionHistoryItemDto (response) with details?: string. |
| src/vs/workbench/api/browser/mainThreadChatSessions.ts | Revives details from DTO into IChatSessionHistoryItem responses. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Returns a ChatResult.details string based on the selected CLI model (pre-swap). |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts | Computes model details during history rebuild and passes it into event→turn conversion. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts | Introduces formatModelDetails() helper. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts | Asserts handleRequest returns details for rendering as footer detail. |
| extensions/copilot/src/extension/chatSessions/copilotcli/common/copilotCLITools.ts | Allows injecting lastResponseDetails and applies it to the final rebuilt response turn. |
| extensions/copilot/src/extension/chatSessions/copilotcli/common/test/copilotCLITools.spec.ts | Adds coverage that rebuilt history preserves result.details. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/test/copilotCliSessionService.spec.ts | Updates constructor call sites for the new ICopilotCLIModels dependency. |
Copilot's findings
- Files reviewed: 12/12 changed files
- Comments generated: 1
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
anthonykim1
commented
Apr 21, 2026
| parts: turn.parts.map((part: IChatProgressDto) => revive(part) as IChatProgress), | ||
| participant: turn.participant | ||
| participant: turn.participant, | ||
| details: turn.details, |
Contributor
Author
There was a problem hiding this comment.
Could pass in result as in:
export interface ChatResult {
nextQuestion?: {
prompt: string;
participant?: string;
command?: string;
};
/**
* An optional detail string that will be rendered at the end of the response in certain UI contexts.
*/
details?: string;
}
but that seems like a waste since I doubt everything there would be something we would use in the future?
rebornix
approved these changes
Apr 22, 2026
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.
Resolves: #303960
microsoft/vscode-copilot-chat#4605 didn't quite work for me — it returns
ChatResult.detailsfrom the request handler, which is fine for local chat, but Copilot CLI goes through the chat session provider api, and on the first request the untitled session gets swapped out for a real one.That swap makes VS Code throw away the in-memory chat model and rebuild history from scratch by replaying sdk events 🧐 — and the replay path was dropping
result.detailson the floor, so the model badge never made it back onto the first response.After this PR you would see: