Merged
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends per-turn model footer details for Copilot CLI and Claude-backed chat sessions by tracking turn-scoped credit usage and surfacing it in ChatResult.details, aligning CLI flows more closely with existing per-turn quota tracking used elsewhere in the Copilot extension.
Changes:
- Add optional per-turn “credits used” formatting to CLI/Claude response footer details.
- Wire
IChatQuotaServiceinto CLI session participants and the Copilot CLI SDK session to accumulate/reset turn credits. - Add
turnIdtracking to Claude session state and forward it into Claude proxy requests sochatMLFetchercan attribute usage to the correct turn.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIModelDetails.ts | Adds optional credits-based details formatting and updates return shape to use computed details. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Injects IChatQuotaService, passes turn credits into model details, and resets credits in finally. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts | Injects IChatQuotaService, passes turn credits into model details, and resets credits in finally. |
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts | Sets/clears per-session turnId and formats details with credits when available. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts | Resets turn credits at request start and attempts to accumulate credits from SDK assistant.usage events. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeSessionStateService.ts | Persists turnId in Claude session state and adds getters/setters. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeLanguageModelServer.ts | Forwards turnId into Claude proxy requests so downstream usage can be attributed per turn. |
| extensions/copilot/src/extension/chatSessions/claude/common/claudeSessionStateService.ts | Extends the shared session-state contract to include turnId accessors. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 5
TylerLeonhardt
approved these changes
May 8, 2026
Member
TylerLeonhardt
left a comment
There was a problem hiding this comment.
approving for Claude. FYI @DonJayamanne
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.
Related #314813