feat(vscode): show usage by routed model#11746
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous Review Summaries (5 snapshots, latest commit d9a5125)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d9a5125)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous review (commit a08fa5f)Status: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Previous review (commit de28740)Status: 2 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (3 files)
Previous review (commit 980af98)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous review (commit dd3aa14)Status: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)SUGGESTION
Files Reviewed (21 files)
Reviewed by gpt-5.4-20260305 · Input: 87.2K · Output: 4.7K · Cached: 197.1K Review guidance: REVIEW.md from base branch |
|
@alex-alecu - can you review this since you are reviewing the first one? Also, it may be good to add the same model name to the auto efficient responses like you did on the TUI, but that can probably be a different PR. |
|
@alex-alecu - this is ready for review |
…del-usage feat(vscode): show usage by routed model



Why
The VS Code session header shows aggregate tokens, context pressure, and total cost, but it does not explain which provider route and concrete model consumed that usage. It also derives the token summary from loaded messages, so unloaded history and delegated subagent work can be omitted.
What changed
The Tokens row now uses the complete persisted task-tree totals from the local model-usage endpoint and becomes an accessible disclosure. Expanding it shows usage grouped by configured provider and model, including steps, direct cost, input/output/reasoning tokens, cache reads/writes, and cache rate. Provider headings keep direct subscriptions distinct from Kilo Gateway routing, while model rows use compact catalog display names with routed-ID fallback.
The extension host owns the authenticated SDK request and workspace routing. Webview state is keyed by session and request UUID, retains successful data during refresh, ignores stale responses, refreshes for relevant root/subagent events and reconnects, and falls back to the existing message-derived Tokens summary when the endpoint is unavailable.
Stack
This PR is stacked on #11608 and targets
feat/tui-routed-model-usagebecause it reuses and extends the local session model-usage endpoint introduced there.