Skip to content

[0.62.0] Expose quota-window history - #584

Merged
Finesssee merged 2 commits into
mainfrom
codex/port-0.62.0-quota-window-history-bridge
Sep 21, 2026
Merged

Finesssee merged 2 commits into
mainfrom
codex/port-0.62.0-quota-window-history-bridge

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This stacked PR adds the display bridge and menu presentation for the quota-window history backend in #583.

  • Exposes provider-scoped Codex and Claude quota-window history through ProviderChartData.
  • Keeps history display-only; it does not feed live quota snapshots, tray state, readiness, pace, rotation, or auto-resume.
  • Reuses the existing Codex cache and Claude parser/pricing/dedup paths, with account scope carried for Claude.
  • Preserves legacy chart payloads with an optional bridge field.
  • Shows incomplete pricing, incomplete coverage, and estimated boundaries explicitly in the UI.
  • Keeps resetObservationsPersisted=false until a durable Claude reset-observation store is added; the UI does not imply that persistence exists.

The implementation is based on the upstream v0.62.0 feature commit b1f14ba2594e2b37b70b18fedc16710e2576066c and is stacked on #583.

Validation

  • cargo fmt --all
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
  • cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path rust/Cargo.toml — 2093 tests: 2092 passed, 1 ignored
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml — 453 passed
  • pnpm --dir apps/desktop-tauri test — 393 passed
  • pnpm --dir apps/desktop-tauri run build
  • ./scripts/local-check.ps1 -Slice ci

The local CUA fresh-desktop proof was not run in this session; the new component has focused React coverage and the frontend build passed. Keep this UI proof as a merge follow-up.

Summary by CodeRabbit

  • New Features
    • Provider charts now show recent Codex and Claude quota-window history, including token usage, costs, time ranges, account scope, and coverage status.
    • Estimated boundaries and incomplete values are clearly marked; historical data is display-only.
    • Chart data remains compatible when quota history is unavailable.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a3d411a9-2d7c-4773-ab57-fb4a695e3a63

📥 Commits

Reviewing files that changed from the base of the PR and between 9491850 and 74cdda5.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • apps/desktop-tauri/src-tauri/src/commands/chart.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs
  • apps/desktop-tauri/src/components/MenuCardDetails.tsx
  • apps/desktop-tauri/src/components/QuotaWindowHistory.test.tsx
  • apps/desktop-tauri/src/components/QuotaWindowHistory.tsx
  • apps/desktop-tauri/src/styles.css
  • apps/desktop-tauri/src/types/bridge.ts
  • rust/src/providers/chart.rs
  • rust/src/providers/mod.rs
 _______________________________________
< Preventing the Matrix from glitching. >
 ---------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Thermo-nuclear code-quality review

I found three high-confidence blockers. This is not an approval.

[P1] Move provider-specific quota projection out of the shared chart command

apps/desktop-tauri/src-tauri/src/commands/chart.rs:280-380 now owns the Codex and Claude quota-history implementations behind a string match provider_id, including direct calls into both provider-specific modules. The Tauri chart transport is becoming the provider dispatcher and will need another branch for every provider. That breaks the provider silo and makes the shared command the place where provider behavior grows.

Expose a provider-neutral quota-history result/service from the Rust provider layer, with Codex and Claude implementations kept in their provider modules. The chart command should only request that result and map it to bridge DTOs; it should not know provider-specific scanning or aggregation details.

[P1] Do not perform three independent Claude log walks for one chart request

build_provider_chart_data_with_cancel first calls the existing daily cost/token paths (apps/desktop-tauri/src-tauri/src/commands/chart.rs:202-220). Those paths each walk Claude project logs (rust/src/cost_scanner.rs:1054-1076 and rust/src/cost_scanner.rs:1145-1167). The new quota path then performs another full scan at chart.rs:334-342. This repeats file I/O, deduplication, pricing resolution, and completeness decisions in separate passes, so chart views can diverge and refresh cost grows with every new projection.

Create one provider-owned, cancellable evidence snapshot/cache per request and derive daily history, local summary, and quota windows from it. Keep the chart command as a thin transport layer.

[P1] Do not ship a persistence-shaped DTO whose value is permanently false

Both provider branches pass empty reset observations (chart.rs:299-300 and chart.rs:343-347) and hard-code reset_observations_persisted: false (chart.rs:331 and chart.rs:375). The bridge therefore advertises a persistence state that can never be true, and every window boundary falls back to estimated reconstruction. This is a half-wired contract, not a usable history capability.

Wire the persisted observation source and its account scope through the provider-owned service before exposing this field, or remove the field and clearly mark the feature as best-effort until persistence exists.

@Finesssee
Finesssee changed the base branch from codex/port-0.62.0-quota-window-history to main September 21, 2026 15:16
@Finesssee
Finesssee force-pushed the codex/port-0.62.0-quota-window-history-bridge branch from 1fd0dc9 to 74cdda5 Compare September 21, 2026 15:19
@Finesssee
Finesssee merged commit 8cdd2ca into main Sep 21, 2026
2 of 3 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.

1 participant