Include Grok in CLI and serve local cost scans (SBS-934) - #325
Conversation
CostScanner and Charts already read ~/.grok/sessions; default cost and /cost still treated Grok as unsupported.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | 9b6d582 | Commit Preview URL Branch Preview URL |
Aug 18 2026, 02:44 AM |
|
Warning Review limit reached
Next review available in: 38 seconds Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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. Comment |
Automated reviewFound 3 issues:
For coding agents: fix BLOCK and FIX IF QUICK findings now; everything else is tracked or informational; never exceed one CodeRev fix round per PR. Advisory. Findings generated by |
…ude-grok # Conflicts: # CHANGELOG.md
Summary
codexbar costand serveGET /costnow scan Grok the same way Charts already does (~/.grok/sessions,costUsdTicks).claude,codex,cursor,grok) no longer lists Grok as unsupported or says only Codex and Claude have local logs.codexbar mcpget_spend. That path now uses the sharedCostScanner::supports_local_scan/scan_providerso the three surfaces cannot drift again. Cursor, Gemini, and Copilot stay unsupported.A user who runs
codexbar costorGET /coston a machine with Grok sessions now sees Grok totals (or "No usage data found"), not "Local cost scanning not available" / "Only Codex and Claude have local logs".codexbar cost -p grokandGET /cost?provider=grokare the same.Test plan
cargo fmt --all --check --manifest-path rust/Cargo.toml— cleancli::cost::tests::grok_cost_is_supported_and_does_not_claim_codex_claude_onlycli::cost::tests::grok_cost_reads_session_ticks_when_sessions_existcli::cost::tests::default_enabled_cost_marks_grok_supportedcost_scanner::tests::scan_provider_supports_grok_and_not_cursorcli::serve::tests::cost_payloads_mark_grok_supported_and_cursor_notcli::mcp::tests::list_providers_and_spend_include_grokcli::mcp::tests::spend_rejects_unsupported_providercli::tests::cost_subcommand_help_mentions_groksupports_local_scan/scan_providerGrok arms. All 6 wiring tests failed (Groksupported: false/supports_local_scanfalse). Restored.cargo test --manifest-path rust/Cargo.toml— 1007 passed; 6 pre-existing Linux failures (Windows\path fixtures). CI rust-shared iswindows-latest.cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings— two pre-existing Linux-only unused/dead_code items insecure_file.rs/updater.rs(Windows-only). Not in this diff.Fail-without-fix
Pattern sweep
Fixed this ticket:
rust/src/cli/cost.rsmatch + "Only Codex and Claude have local logs" + clap helprust/src/cli/serve.rscost_responserust/src/cli/mcp.rsCOST_SUPPORTED/ get_spend / list_providers / instructionsrust/src/cli/mod.rscost about textdocs/CLI.mdcost sectionLeft alone, with why:
statusline --no-costreads the widget snapshot, not local logs.apps/desktop-tauri/src/surfaces/ChartsPanel.tsxstill says "Codex/Claude also scan local transcripts". Charts already includes Grok; comment only. Not CLI.What this makes more likely
Default
codexbar cost,GET /cost, and MCPget_spendnow walk~/.grok/sessionson every run. A bug inscan_grok_reportis no longer Charts-only. Grok session trees are small relative to Codex/Claude JSONL; the extra pass is the same one Charts already pays.Gaps
-D warningsare red on this Linux box for pre-existing Windows-path / Windows-only items. Required CI job iswindows-latest.codexbar serveHTTP socket;/costis covered bycost_payloadsunit tests.Closes nothing on GitHub. Linear: SBS-934. Not merged.
Note
Add Grok support to
codexbar costCLI, MCP tools, and/costHTTP endpointCostScanner::scan_provider,scan_grok, andsupports_local_scanmethods to centralize provider dispatch and expose a single source of truth for which providers have local logs.costCLI command, MCPget_spend/list_providerstools, and theGET /costserve handler to include Grok alongside Codex and Claude — replacing hardcoded two-provider lists with dynamic lookups viaCostScanner.Macroscope summarized 9b6d582.