Skip to content

Feature/token tracking#957

Open
davi0015 wants to merge 2 commits intovoideditor:mainfrom
davi0015:feature/token-tracking
Open

Feature/token tracking#957
davi0015 wants to merge 2 commits intovoideditor:mainfrom
davi0015:feature/token-tracking

Conversation

@davi0015
Copy link
Copy Markdown

No description provided.

h2balloon added a commit to h2balloon/voidberg that referenced this pull request Apr 30, 2026
Cherry-picked from voideditor/void#957 (davi0015), with fixes:

Adds an SVG donut ring around the send button showing totalTokens /
contextWindow for the active thread. Color-coded violet/yellow/red at
50% and 80% thresholds. Hover tooltip shows per-bucket breakdown
(input / output / reasoning / total). Usage persists on the thread so
the ring shows the last-known value immediately after reload.

Gemini usage is extracted from usageMetadata in the streaming handler.
OpenAI and Anthropic support can be wired in a follow-up.

Fixes applied over the original PR:
- Disk write (_storeAllThreads) now only happens on onFinalMessage, not
  every streaming chunk, avoiding constant I/O during generation
- Removed console.log and dead modelInfoOfRequestId tracking map

Co-Authored-By: davi0015 <noreply@github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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