Skip to content

feat(usage): export daily token activity as CSV - #4877

Merged
gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-daily-usage-export-20260913
Sep 13, 2026
Merged

gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-daily-usage-export-20260913

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Why this matters

The Usage activity screen shows daily UTC token counters, but its only CSV export is grouped by model. Operators comparing days or reconciling prompt, completion, and cache activity must manually copy the table.

Add Export daily CSV beside Token activity. It exports the currently displayed days, keeps cache reads and writes separate, excludes future rows, and names the file with the observed date range. Unavailable counters remain empty; measured zero remains zero. Export is disabled for loading, unavailable, failed, and empty reports. Browser download failures are visible and an explicit retry is supported; temporary links and object URLs are cleaned up.

Overlap check

Searched all open/closed PR titles, bodies, and changed files for daily CSV/export, usage report export, UsageView.jsx, and Usage.jsx. #3839/#4345/#4352/#4416 address the existing model CSV's escaping, unknown costs, and download lifecycle. #3847 changes model ranking. This adds a separate daily activity export using only canonical dates and finite nonnegative numeric cells, and does not modify the existing model exporter.

Validation

  • npm test -- --run src/components/usage src/pages/Usage.test.jsx src/pages/Usage.history.test.jsx: 31 passed. The six new rendered Activity-view tests failed before wiring the new control.
  • Tests inspect the downloaded Blob's exact CSV bytes and filename, future-day omission, unknown request counters, all unavailable states, cleanup, and retry after failure.
  • Dashboard lint and production build, scoped pre-commit, and git diff --check passed.

This is a browser-side export of the displayed API snapshot; it does not fetch extra history or claim accounting completeness. No cost fields or provider/model identifiers are exported. No backend or storage mutation; rollback removes the control.

Batch baseline: root/WSL no-sudo and preflight fixtures prevent a clean full local gate; all-file key scanning flags two unchanged dummy fixtures. Smoke and installer simulation passed. Native browser download UI was not automated.

@gabsprogrammer
gabsprogrammer merged commit a52f54d into Osmantic:public-beta Sep 13, 2026
36 checks passed
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.

2 participants