feat: DeepSeek usage panel — balance, per-request cost, daily history#167
Open
rbinar wants to merge 1 commit into
Open
feat: DeepSeek usage panel — balance, per-request cost, daily history#167rbinar wants to merge 1 commit into
rbinar wants to merge 1 commit into
Conversation
…ory) Adds a status bar entry and webview panel surfacing DeepSeek account balance, estimated per-request cost, and persistent daily usage history. Usage is sourced solely from the provider's own request stream (provideLanguageModelChatResponse-reported usage) and aggregated by day, model, and total, plus a chronological per-request breakdown. No VS Code internal storage is read, and no prompt text or chat titles are persisted. Conversation-level grouping is intentionally deferred until VS Code exposes a stable session id to the provider API (microsoft/vscode#305853).
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.
Focused, panel-only split of #163, per the review feedback there. This branch contains only the usage panel — nothing else.
What
$(hubot)) that opens a webview panel/user/balanceconsts.tsHow usage is sourced
Usage comes solely from the provider's own request stream — the
usagereported toprovideLanguageModelChatResponseis fed into the tracker via a single hook instream.ts. This is stable and authoritative; the panel reads no VS Code internal storage and persists no prompt text or chat titles.Scope
This PR is intentionally limited to the panel. Everything else that was bundled into #163 is excluded and left to its own PRs:
package-lock.jsonchurnDiff is purely additive: 2 new files (
src/balance.ts,src/tracker.ts), the panel wiring insrc/runtime/lifecycle.ts, a 3-linemodelIdfield for usage attribution inrequest.ts, a singlerecordUsagehook instream.ts, and theviews/viewsContainerscontributions inpackage.json.Deferred
Conversation-level grouping is omitted until VS Code exposes a stable session id to the provider API (microsoft/vscode#305853). The tracker leaves a clean seam to add it later.
Supersedes #163 (and the earlier #158).