Skip to content

Copilot Token Usage 0.1.0

Choose a tag to compare

@Albert-code-1114 Albert-code-1114 released this 26 Sep 15:49
· 3 commits to main since this release

First release.

Status-bar readout of this request / today's total tokens for GitHub
Copilot Chat, including BYOK and custom-endpoint models. It reads the
OpenTelemetry JSON Lines file Copilot Chat can already export itself --
no proxy to run, nothing patched.

Added

  • Status bar readout in four formats (lastDay, last, day, cost).
  • otel-file data source reading the github.copilot.chat.otel.* export:
    • understands all three record shapes that can appear -- OTel log records
      (what the file exporter actually writes), OTLP span envelopes, and raw
      SDK spans
    • incremental reads: only new bytes are parsed
    • per-call de-duplication id persisted across window reloads, so replaying
      the file from byte 0 never double-counts
    • events from other local dates are discarded, not folded into today
  • Details panel: today's summary, per-model split, last 30 requests.
  • Markdown report export.
  • 诊断数据源 command: per-source connection state, lines read, and a verdict
    explaining a zero.
  • Optional local price list and cost estimation.
  • Model exclusion by substring (e.g. the small utility model Copilot uses to
    title conversations).
  • Offline test suite -- 4 suites / 87 assertions, no VS Code required.

Install

Download copilot-otel-usage-0.1.0.vsix below, then:

code --install-extension copilot-otel-usage-0.1.0.vsix

Then point it at the export file -- see the Install section of the README.

Notes

  • Reads only the officially exported surface. It does not patch, instrument,
    or modify VS Code or the Copilot extension.
  • Command titles and UI text are Chinese in this release.