Skip to content

[0.63.0] Show reported provider spend on dashboard - #588

Merged
Finesssee merged 2 commits into
mainfrom
codex/port-0.63.0-dashboard-spend
Sep 23, 2026
Merged

Finesssee merged 2 commits into
mainfrom
codex/port-0.63.0-dashboard-spend

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ports upstream CodexBar commit f65c002a8 (dashboard reported provider spend) into Win-CodexBar.

  • Use the existing provider-owned 30-day UTC cost snapshot when no local dashboard cost payload exists.
  • Preserve known zero values while leaving todayUSD unset because provider history can use completed UTC buckets.
  • Reject non-USD, non-30-day, and ordinary billing snapshots from this fallback.
  • Preserve local cost precedence even when the local payload has no amount.

Validation

  • cargo fmt --all
  • cargo test --manifest-path rust/Cargo.toml --lib cli::serve::dashboard::snapshot::snapshot_tests (26 passed)
  • cargo clippy --manifest-path rust/Cargo.toml --lib --tests -- -D warnings
  • cargo test --manifest-path rust/Cargo.toml --lib (2101 passed, 1 ignored)
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Dashboard cost summaries can now display eligible provider-reported USD costs for the last 30 days (UTC).
    • Reported costs appear in the 30-day total without adding a “today” amount when unavailable.
  • Bug Fixes

    • Improved cost selection so available local cost data takes precedence, while provider-reported data is used when local data is unavailable.
    • Unsupported currencies, labels, or non-visible costs are excluded from dashboard cost summaries.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: dca801f1-39f7-49be-818b-2e8166a523bf

📥 Commits

Reviewing files that changed from the base of the PR and between 3782c6e and 7c1cc91.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 54f5ea93-983c-4380-993b-472c7b637d3b

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdd2ca and 3782c6e.

📒 Files selected for processing (2)
  • rust/src/cli/serve/dashboard/snapshot.rs
  • rust/src/cli/serve/dashboard/snapshot_tests.rs

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


📝 Walkthrough

Walkthrough

The dashboard now maps eligible provider-reported USD costs to last30DaysUSD. Local cost payloads take precedence, including payloads with unavailable amounts. Tests cover eligible, unsupported, and precedence cases.

Changes

Provider cost reporting

Layer / File(s) Summary
Cost projection, selection, and validation
rust/src/cli/serve/dashboard/snapshot.rs, rust/src/cli/serve/dashboard/snapshot_tests.rs
Eligible always-visible finite USD snapshots for Last 30 days (UTC) populate last30DaysUSD and leave todayUSD unset. Local cost payloads take precedence over provider fallback. Tests cover zero and nonzero values, unsupported snapshots, and missing local amounts.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: tlq5l

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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: showing provider-reported spend on the dashboard.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files.
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.
✨ 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 review at 7c1cc910e3bfb47023491704511e6f9c8deca5a1: PASS, no blocking findings.

Independent review covered reported_cost_payload, its build_provider integration, and dashboard snapshot tests. Reported provider cost is admitted only for a successful snapshot with always_visible, USD, the expected 30-day UTC period, and finite amounts. Local cost payloads keep precedence even when their amount is unavailable. Tests cover zero/nonzero values and rejected currency, period, visibility, and local-precedence cases.

The helper is focused and the patch adds no structural blocker. Native UI proof is not applicable to this backend-only change. The branch now contains the merged #607 login-test fix; the required CircleCI gate is running for this revision.

@Finesssee
Finesssee merged commit b183728 into main Sep 23, 2026
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