Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 8

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5632b3b4-3106-4ab3-a984-90e28e0f42ff
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 112-
config/scripts/orcad-entry-build.mjssrc/main/claude-accounts/claude-profile-installed-router.tssrc/main/claude-usage/claude-usage-report-aggregation.tssrc/main/claude-usage/claude-usage-session-rows.tssrc/main/claude-usage/persisted-source-cache.tssrc/main/claude-usage/persisted-usage-test-fixture.tssrc/main/claude-usage/scanner.tssrc/main/claude-usage/store.test.tssrc/main/claude-usage/store.tssrc/main/claude-usage/transcript-file-discovery.tssrc/main/claude-usage/transcript-projection-integrity.tssrc/main/claude-usage/transcript-resume-projection.tssrc/main/claude-usage/transcript-token-checkpoint.tssrc/main/claude-usage/transcript-usage-projection.tssrc/main/claude-usage/types.tssrc/main/claude-usage/usage-aggregation.tssrc/main/codex-usage/codex-rollout-file-parse.tssrc/main/codex-usage/codex-usage-provider.tssrc/main/codex-usage/codex-usage-rollup-projections.tssrc/main/codex-usage/codex-usage-session-rows.tssrc/main/codex-usage/scanner-file-generation.test.tssrc/main/codex-usage/scanner-file-identity.test.tssrc/main/codex-usage/scanner.tssrc/main/codex-usage/store-persistence.test.tssrc/main/codex-usage/store-test-harness.tssrc/main/codex-usage/store.tssrc/main/codex-usage/types.tssrc/main/codex/codex-account-home-discovery.tssrc/main/ipc/usage-provider-handlers-readiness.test.tssrc/main/ipc/usage-provider-handlers.tssrc/main/muse-usage/muse-usage-provider.tssrc/main/muse-usage/snapshot-rollups.tssrc/main/muse-usage/store.tssrc/main/opencode-usage/opencode-usage-account-roots.tssrc/main/opencode-usage/opencode-usage-provider.tssrc/main/opencode-usage/scanner.tssrc/main/opencode-usage/snapshot-rollups.tssrc/main/opencode-usage/store.test.tssrc/main/opencode-usage/store.tssrc/main/opencode-usage/types.tssrc/main/orcad/orcad-entry.tssrc/main/orcad/orcad-secret-store-startup.tssrc/main/orcad/orcad-usage-history.tssrc/main/runtime/construction/runtime-agent-provider-session-rows.tssrc/main/runtime/construction/runtime-host-services.tssrc/main/runtime/rpc/methods/index.tssrc/main/runtime/rpc/methods/usage-history.test.tssrc/main/runtime/rpc/methods/usage-history.tssrc/main/startup/main-process-ready-duplicate-pty-repair.test.tssrc/main/startup/main-process-runtime-service.tssrc/main/usage/usage-account-attribution.test.tssrc/main/usage/usage-account-attribution.tssrc/main/usage/usage-calendar-range.tssrc/main/usage/usage-event-aggregation.tssrc/main/usage/usage-history-projection.test.tssrc/main/usage/usage-history-projection.tssrc/main/usage/usage-provider-facade.tssrc/main/usage/usage-provider-store-initialization.test.tssrc/main/usage/usage-provider-store-lifecycle.test.tssrc/main/usage/usage-provider-store-lifecycle.tssrc/main/usage/usage-rollup-records.tssrc/main/usage/usage-scan-worker-entry.tssrc/main/usage/usage-scan-worker-event-loop.test.tssrc/main/usage/usage-scan-worker-protocol.tssrc/main/usage/usage-scan-worker-spawn.tssrc/main/usage/usage-session-selection.tssrc/main/usage/usage-source-cache-file.tssrc/preload/api/agent-usage-api.tssrc/preload/usage-provider-api.tssrc/renderer/src/components/settings/settings-interface-secondary-section-renderers.tsxsrc/renderer/src/components/stats/ClaudeUsageDetails.tsxsrc/renderer/src/components/stats/CodexUsageDailyChart.tsxsrc/renderer/src/components/stats/CodexUsagePane.test.tsxsrc/renderer/src/components/stats/GrokUsagePane.test.tsxsrc/renderer/src/components/stats/OpenCodeUsageDetails.tsxsrc/renderer/src/components/stats/StatsPane.tsxsrc/renderer/src/components/stats/StatsPane.usage.test.tsxsrc/renderer/src/components/stats/UsageAccountQuotas.test.tsxsrc/renderer/src/components/stats/UsageAccountQuotas.tsxsrc/renderer/src/components/stats/UsageHistoryDetails.tsxsrc/renderer/src/components/stats/UsageHistoryFilter.tsxsrc/renderer/src/components/stats/UsageHistoryFilters.tsxsrc/renderer/src/components/stats/UsageOverviewPane.tsxsrc/renderer/src/components/stats/UsageRecentSessionsTable.tsxsrc/renderer/src/components/stats/usage-account-quota-rows.tssrc/renderer/src/components/stats/usage-formatters.test.tssrc/renderer/src/components/stats/usage-formatters.tssrc/renderer/src/components/stats/usage-history-accounts.tssrc/renderer/src/components/stats/usage-history-client.tssrc/renderer/src/components/stats/usage-history-model.test.tssrc/renderer/src/components/stats/usage-history-model.tssrc/renderer/src/components/stats/usage-overview-model.tssrc/renderer/src/components/stats/usage-overview-sections.tsxsrc/renderer/src/components/stats/use-usage-history.test.tssrc/renderer/src/components/stats/use-usage-history.tssrc/renderer/src/components/status-bar/use-owner-usage-rate-limits.test.tsxsrc/renderer/src/components/status-bar/use-owner-usage-rate-limits.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/runtime-provider-accounts-client.tssrc/renderer/src/web/web-preload-api-usage-history.test.tssrc/shared/claude-usage-types.tssrc/shared/codex-usage-types.tssrc/shared/muse-usage-types.tssrc/shared/opencode-usage-types.tssrc/shared/orcad-artifacts.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/usage-history-params.tssrc/shared/usage-history-aggregation.tssrc/shared/usage-history-range.tssrc/shared/usage-history-rpc.tssrc/shared/usage-history-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/renderer/src/components/stats/StatsPane.usage.test.tsx: 1
293-293:Trivial · Functional Correctness · Quick win Assert the no-history placeholder.
The
not.toHaveTextContent('0.0k')assertion also passes when the total renders as0or0 tokens.UsageOverviewPaneexplicitly renders—when no history rows exist, so assert the exact placeholder to catch this regression.Suggested fix
- expect(screen.getByTestId('usage-history-totals')).not.toHaveTextContent('0.0k') + expect(screen.getByTestId('usage-history-totals')).toHaveTextContent('—')

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d343fdfc-5c6a-4712-a34e-253a1b4c670c
Files selected for processing: 1-
src/renderer/src/components/stats/StatsPane.usage.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
|
Addressed the optional no-history assertion note in review 5641699842 in a8f84fd. The existing unavailable-history test now scopes to the Tokens card within Local validation on Node 24.22.0 with |
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8fbe62d5-9cd9-4bda-a420-76358ee32ee5
Files ignored due to path filters: 2-
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlsrc/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 30-
package.jsonsrc/main/codex-usage/codex-rollout-file-parse.tssrc/main/codex-usage/codex-usage-provider.tssrc/main/codex-usage/store-persistence.test.tssrc/main/codex-usage/types.tssrc/main/opencode-usage/opencode-usage-provider.tssrc/main/opencode-usage/scanner.tssrc/main/opencode-usage/types.tssrc/main/orcad/orcad-entry.tssrc/main/orcad/orcad-secret-store-startup.tssrc/main/runtime/construction/runtime-agent-provider-session-rows.tssrc/main/runtime/construction/runtime-host-services.tssrc/main/runtime/rpc/methods/index.tssrc/main/startup/main-process-runtime-service.tssrc/main/usage/usage-event-aggregation.tssrc/main/usage/usage-rollup-records.tssrc/main/usage/usage-scan-worker-entry.tssrc/main/usage/usage-scan-worker-event-loop.test.tssrc/main/usage/usage-scan-worker-protocol.tssrc/main/usage/usage-scan-worker-spawn.tssrc/main/usage/usage-source-cache-file.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/stats/CodexUsageDailyChart.tsxsrc/renderer/src/components/stats/StatsPane.tsxsrc/renderer/src/components/stats/usage-overview-sections.tsxsrc/renderer/src/components/status-bar/use-owner-usage-rate-limits.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/shared/orcad-artifacts.tssrc/shared/protocol-version.ts
Files skipped from review as they are similar to previous changes: 3-
- src/renderer/src/assets/main.css
- src/renderer/src/components/stats/usage-overview-sections.tsx
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
fc5dd9e to
38e07c0
Compare
…with provider charts
…pr-33371 # Conflicts: # tests/e2e/usage-overview.spec.ts
ELI5
Read historical token usage from the selected host, filter it by provider/account/model/project/date, and compare daily provider trends.
What Changed
Reuses host-owned provider stores, recorded account attribution and existing RPC ownership to expose history and daily charts. Unknown identity, missing history and unavailable prices stay explicit; API-equivalent estimates are not subscription bills. This refresh preserves upstream daemon idle policy, tab-scoped provider rows, usage-limit RPCs and capability bundling.
Why
Current quota snapshots cannot explain historical usage. Recorded history must stay with the host that collected it and must not infer past account identity from the current login.
Linked Issue
Fixes #39518. Related: #23389 (history from SSH hosts) and #29676 (single overview period).
Visual Proof
Historical English component evidence; no new capture is claimed for this refresh.
Before: frozen upstream
d58849a7d8d68929bd0e686571678d85e70740af. After: standalone47bfa883da0d3e8898dbcb6f49c31c5288a9affb. Matched component pairs use identical synthetic data, dark theme and 1280×900 viewport.Before: usage before desktop
After: usage after desktop
After: usage after project history
After: usage after history account filter
Actual StatsPane and usage components with synthetic collector/account responses. Project/account/date filtering and unchanged account-wide quota values passed; this rendered proof does not establish real billing, collector scanning or remote compatibility. All final component runs had zero page errors and hidden, unfocused windows; captures ran on macOS through approved outside-sandbox execution. No private user screenshot is published and no image is committed to this PR. Full rendered evidence: gentslava#1.
Daily provider trends and comparative shares
Final chart refinement at
af189a86ecd, with filter/zero-day regressions in79dd6a8110d, compared with pre-chart7ee4545332f, using synthetic fixture records:Provider curves use monotone smoothing without extra extrema, solid strokes and matching area fills. Days without recorded provider usage connect at zero; recorded usage with unknown prices remains explicitly unavailable in cost mode. Idle dots and guide lines stay hidden; hover and keyboard focus expose exact values. Historical totals remain ledger-derived.
The matched pre-chart capture, light theme are supplemental. Latest hidden CDP evidence exercises all four providers, 7/30/90/all periods, zero-day readout, hover, keyboard/day selection, metric switching, 420px layout and unchanged quota text. No live account or billing evidence is claimed.
Testing
Current head:
5b9b9eef657e3552eb4b5893b3d5898a194b96ad. Ordinary forward merge of upstream main8a4dd3a7bb9bd7f96b68dec621433431d77dc8c1. Updated affected imports to their current owners.All five desktop/runtime TypeScript projects pass with the supported tsrs compiler. The complete affected source test files pass 152 tests.
Normal commit hooks pass. Final changed-path gate: all non-unit checks passed; broad related-unit selection exceeded the one-minute limit and remains incomplete locally. No new installed-app/device, live-provider, SSH, Windows or Linux acceptance is claimed for this maintenance refresh.
Risk
Level: Medium
Attribution, cache identity and remote ownership are the main risks; errors could group usage under the wrong account or host. Existing unknown/unavailable states remain explicit. A plain revert removes the history surface and collector integration; recorded caches may remain on disk.
AI Disclosure
Implemented and checked with Codex assistance. The contributor owns the change and validation.
Review
Previously reported session-count fallback, ordering, token totals, filter labels and day-boundary issues remain fixed. The suggested local quota-watcher simplification was withdrawn because it could attach a stale account label to new quota data.
Agent skill upstream boundary
Notes
Source:
53f589d96e85efff6f46dfd3ac7c96d1d8e9b32b. Frozen upstream main:18f674e69ff6708b634f53d668582d3943acb74d. Prepared from the exact published PR head with an ordinary forward merge. Local checks above are scoped to this atomic contribution.Checklist