Skip to content

Port 0.61.0 transient provider inventory plumbing - #560

Open
Finesssee wants to merge 1 commit into
mainfrom
codex/port-0.61.0-inventory
Open

Finesssee wants to merge 1 commit into
mainfrom
codex/port-0.61.0-inventory

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a small transient provider inventory channel to ProviderFetchResult.
  • Project inventory explicitly through CLI JSON/text, the Tauri bridge, provider details, and the React usage surfaces.
  • Keep inventory outside quota arithmetic, persistence, tray metric selection, pace, notifications, and auto-resume behavior.

Validation

  • cargo test --manifest-path rust/Cargo.toml --lib cli::usage::tests
  • cargo test --manifest-path rust/Cargo.toml --lib providers::grok::billing::tests
  • cargo check --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml
  • cargo fmt --all

Frontend targeted tests were not run because apps/desktop-tauri/node_modules is absent; no dependency install or frontend build was started.

This is the 0.61.0 prerequisite for the dependent Grok reset-coupon port. It contains no Grok network behavior.

Summary by CodeRabbit

  • New Features
    • Added display-only provider inventory details, including item names, available counts, and reset/expiry times.
    • Inventory appears in provider usage sections and menu card details without being treated as quota usage.
    • CLI usage output now includes inventory information in full text and JSON formats.
  • Bug Fixes
    • Prevented sensitive token identifiers from appearing in provider inventory output.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0e82ce7e-0a32-4de5-aaf0-9062aa92eeef

📥 Commits

Reviewing files that changed from the base of the PR and between 10e3b09 and 4ceb88f.

📒 Files selected for processing (13)
  • apps/desktop-tauri/src-tauri/src/commands/bridge.rs
  • apps/desktop-tauri/src-tauri/src/commands/provider_detail.rs
  • apps/desktop-tauri/src-tauri/src/commands/providers.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs
  • apps/desktop-tauri/src-tauri/src/powertoys.rs
  • apps/desktop-tauri/src-tauri/src/tray_bridge.rs
  • apps/desktop-tauri/src-tauri/src/usage_metric.rs
  • apps/desktop-tauri/src/components/MenuCardDetails.tsx
  • apps/desktop-tauri/src/surfaces/settings/providers/sections/UsageSection.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/providers/sections/UsageSection.tsx
  • apps/desktop-tauri/src/types/bridge.ts
  • rust/src/cli/usage.rs
  • rust/src/core/usage_snapshot.rs

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The PR adds display-only provider inventory data to core fetch results, bridge snapshots, CLI output, and desktop usage views. Inventory includes item identifiers, titles, available counts, and optional expiry times. Redemption tokens remain excluded from serialized data.

Changes

Provider inventory

Layer / File(s) Summary
Inventory data model
rust/src/core/usage_snapshot.rs
Adds transient ProviderInventoryItem data and builder support. Inventory remains separate from quota calculations and persisted fetch-result JSON.
Bridge snapshot propagation
apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src-tauri/src/commands/provider_detail.rs, apps/desktop-tauri/src-tauri/src/commands/tests.rs, apps/desktop-tauri/src-tauri/src/commands/providers.rs, apps/desktop-tauri/src-tauri/src/powertoys.rs, apps/desktop-tauri/src-tauri/src/tray_bridge.rs, apps/desktop-tauri/src-tauri/src/usage_metric.rs
Maps inventory into bridge snapshots and provider details. Error snapshots and existing test fixtures initialize empty inventories.
CLI inventory output
rust/src/cli/usage.rs
Adds inventory to JSON output and full text output. Full text includes formatted expiry countdowns, while brief text omits inventory.
Desktop usage rendering
apps/desktop-tauri/src/types/bridge.ts, apps/desktop-tauri/src/surfaces/settings/providers/sections/UsageSection.tsx, apps/desktop-tauri/src/surfaces/settings/providers/sections/UsageSection.test.tsx
Adds bridge inventory types and renders inventory rows after usage bars. Inventory does not render as a quota bar.
Menu card inventory rendering
apps/desktop-tauri/src/components/MenuCardDetails.tsx
Adds inventory presence detection and renders item titles, available counts, and optional expiry values in menu cards.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: tlq5l

Sequence Diagram(s)

sequenceDiagram
  participant ProviderFetchResult
  participant BridgeSnapshot
  participant DesktopUsageView
  participant CliUsageRenderer
  ProviderFetchResult->>BridgeSnapshot: provide inventory items
  BridgeSnapshot->>DesktopUsageView: expose inventory and expiry
  ProviderFetchResult->>CliUsageRenderer: provide inventory items
  CliUsageRenderer-->>CliUsageRenderer: format JSON or text output
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: porting transient provider inventory plumbing for version 0.61.0.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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.

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