Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adversarial validation (lane-B review)Head validated: Verdict: no blocking defects. Spec coverage verified in source at head:
Validation re-run at head (pinned 1.98.0, E-cores): UI proof: waived per user 2026-10-02 directive (fast-track); the marker surfaces are covered by the new Rust tests. |
UI proof (browser-use)Combined build of
Every surface also passed the privacy check (no email-like text, account e-mail nodes or profile paths in the DOM) and theme Validation at |
…quest usage Conflicts in cost_scanner.rs, cli/cost.rs, cli/serve/data.rs, commands/chart.rs, keys.ts, locale.rs and en-US.ftl. cost_scanner.rs: the incomplete-request tracker is threaded through the release multi-root Claude walk (claude_projects_roots + walk_claude_roots) in the summary scan, the chart snapshot scan and the daily cost history; the release aggregation and unknown-date tracking is kept. Preliminary rows still keep coverage unknown (unchanged is_complete). The release-only daily-token scan and the claude-swap test pass a throwaway tracker. The tracker buckets days with the pinned cost_bucket_zone() like the daily cost buckets, so a marker lands on the chart day it belongs to. cli/cost.rs: incomplete note and JSON count kept next to the release period stamping (stamp_period) and the 4-argument build_json_payloads. serve /cost: the Claude chart snapshot now supplies daily_incomplete with its daily rows (no second walk); other providers use get_daily_cost_and_incomplete_history over the rolling period window. commands/chart.rs: the menu-card note sits under the selected-period totals, so the summary count comes from the period summary (equal to the 30-day scan for the default period). Locale keys follow UsageSpendKnownSubtotal.
Found by the 0.60.4-0.69.0 port gap audit.
What upstream did
Upstream CodexBar v0.60.5, bullet 4 (steipete#3688, commit 2d93342): preliminary Claude proxy usage rows (null
stop_reason, input > 0, output == 0, no cache fields) are excluded from cost and tokens, but are now counted per day and per model asincompleteRequestCount. A completed record with the same key wins over an incomplete one. A day or period that only has incomplete requests stays unavailable instead of showing $0. "Incomplete" markers then show up in the menu and tray, chart tooltips, Usage & Spend, share/export, CLI text, CLI JSON and the web dashboard.What this ports
rust/src/cost_scanner/claude_incomplete.rs,cost_scanner.rs): the existing preliminary-row filter (already matching upstream) now records each excluded row. Rows are de-duplicated by the existing Claude dedup key, dropped if a completed row with the same key was counted, and bucketed per local day and per model.CostSummarygainsincomplete_request_countandincomplete_by_model;ClaudeChartSnapshotgainsdaily_incomplete; newget_daily_cost_and_incomplete_history.Total:line gets· Incompleteplus aIncomplete: N requests lacked final usage and were excluded from tokens and cost.line; an incomplete-only scan prints "No completed usage data found" plus that note instead of "No usage data found".serve/costJSON:incompleteRequestCountonly when > 0, and per-dayincompleteRequestCounton theservedaily rows.commands/chart.rs): optionalincompleteRequestCountonDailyCostPointandProviderLocalUsageSummary(omitted when zero).IncompleteRequestsLabelandIncompleteRequestsDetail(en-US; other locales fall back).What this leaves out, and why
serveweb dashboard HTML markers: not done in this micro PR to keep the change reviewable. The data is now available in the bridge andserveJSON for a follow-up.incompleteRequestCountinmodelBreakdownsJSON, and the cached-report migration: Windows has nomodelBreakdownspayload or persisted Claude report cache (the scanner rebuilds from transcripts on every scan), so there is nothing to migrate. Per-model counts are kept onCostSummaryonly.Tests run
cargo +1.98.0 fmt --allcargo +1.98.0 clippy --workspace --all-targets -- -D warningson bothrust/Cargo.tomlandapps/desktop-tauri/src-tauri/Cargo.toml: cleancargo test -p codexbar: 2165 passed (new: tracker unit tests, scan reconciliation test, CLI JSON/suffix tests, serve daily JSON test)cargo test -p codexbar-desktop-tauri: 461 passed, 1 failed: the knownbootstrap_payload_exposes_every_provider_variant(fixed by Isolate bootstrap payload test from real settings #684, unrelated)pnpm test(405 passed, includes newincompleteRequestsandMiniBarCharttests),pnpm run lint(only pre-existing warnings),pnpm run build: cleanUI proof
UI-affecting (menu card note, chart tooltips). Draft: CUA proof on a fresh debug build is still to do and is not attached yet.