Repository navigation
Description
Refreshing Usage after a successful load can replace real spending with “No usage” when the request fails. Fleet retains its old report but hides the failure, making stale data look refreshed.
Reproduced
Mounted the real views with a successful response followed by a rejected refresh:
- Usage initially displays a $12.50 fixture report. After failure the amount disappears, “No usage” appears, and there is no error alert.
- Fleet initially displays a nonempty evidence report. After failure that report remains, but neither the error nor a stale-data warning is visible.
Runnable assertion:node --import=./test/support/disable-grok-mcp.mjs --import=./test/support/render.mjs --experimental-strip-types docs/issue-drafts/2026-09-08-view-actions-evidence.mjs. The amount is synthetic test data, not user billing.
Cause and minimal fix
UsageView.tsx catches failed loads by replacing report state with EMPTY_REPORT and has no error state. FleetView.tsx retains evidence and sets error, but only renders that error in the empty-report branch. InsightsView.tsx already demonstrates rendering an error alongside existing data; reuse that pattern.
Acceptance
- Preserve the last successful report after a failed refresh, with a visible accessible error and stale/last-success indication.
- Initial failure shows an error with retry, distinct from a successfully loaded empty report.
- Successful retry clears the failure/stale indication and updates the report.
- Retain the selected reporting range/metric; changing scope must not present another scope's old data as current.
- Loading controls recover on failure. Never fabricate zero spend from a rejected request.
- Add focused initial-failure and success→failure→success checks for both views.
Duplicate check
#943 explicitly covers Activity and Digest. These are different view owners with two separately reproduced failures, including destructive replacement of Usage report state. #899 concerns provider quota freshness; #946 concerns Usage thread drilldown; #556 concerns accounting values. This issue changes refresh presentation and recovery, not accounting or provider quota collection.
Parent audit #1130. Audited at 6c7a6fb; UsageView and FleetView blobs matched the default branch during verification.
Activity
currentbits commentedon Sep 8, 2026
Landed from Solenta thread "Usage erases its report and Fleet hides failures when refres". Closed on merge.