Repository navigation
feat(usage): export daily token activity as CSV - #4877
Merged
gabsprogrammer merged 1 commit intoSep 13, 2026
Merged
gabsprogrammer merged 1 commit into
gabsprogrammer merged 1 commit into
Conversation
This was referenced Sep 16, 2026
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.
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, andUsage.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.git diff --checkpassed.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.