Skip to content

feat: DeepSeek usage panel — balance, per-request cost, daily history#167

Open
rbinar wants to merge 1 commit into
Vizards:mainfrom
rbinar:feat/usage-panel
Open

feat: DeepSeek usage panel — balance, per-request cost, daily history#167
rbinar wants to merge 1 commit into
Vizards:mainfrom
rbinar:feat/usage-panel

Conversation

@rbinar

@rbinar rbinar commented Jun 17, 2026

Copy link
Copy Markdown

Focused, panel-only split of #163, per the review feedback there. This branch contains only the usage panel — nothing else.

What

  • Status bar entry ($(hubot)) that opens a webview panel
  • Account balance from /user/balance
  • Estimated cost per request, derived from the model pricing already in consts.ts
  • Persistent daily usage history (input/output tokens, request count, cost) with day-boundary reset, plus a chronological per-request breakdown and a per-model rollup
  • Reset button and quick links

How usage is sourced

Usage comes solely from the provider's own request stream — the usage reported to provideLanguageModelChatResponse is fed into the tracker via a single hook in stream.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:

Diff is purely additive: 2 new files (src/balance.ts, src/tracker.ts), the panel wiring in src/runtime/lifecycle.ts, a 3-line modelId field for usage attribution in request.ts, a single recordUsage hook in stream.ts, and the views/viewsContainers contributions in package.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).

…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).
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.

1 participant