Conversation
…ls in CLI usage text
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
…ty summary (#703) Merge port/micro-0.61.0-openrouter-activity-summary. Both branches change openrouter/activity.rs: keep #703's checked safe-integer token aggregate as the single token total for the CLI history line (dropping this branch's separate saturating sum, which would double count after the merge), keep the cost provenance, and move this branch's tests to the ActivityReport return shape.
Stacked on #703 and re-validatedResult: #708 is now stacked on #703, re-validated at #703 and #708 both rewrite the OpenRouter Activity aggregation in What changed
Upstream check (v0.61.0, read-only)
Validation at
|
| Command | Result |
|---|---|
cargo +1.98.0 fmt --all --check |
pass |
cargo +1.98.0 clippy --workspace --all-targets -- -D warnings |
pass |
cargo +1.98.0 test -p codexbar openrouter |
41 passed |
cargo +1.98.0 test -p codexbar usage |
208 passed |
cargo +1.98.0 test -p codexbar |
2176 passed, 0 failed, 1 ignored |
cargo +1.98.0 test -p codexbar-desktop-tauri -- --skip bootstrap_payload_exposes_every_provider_variant |
461 passed, 0 failed. The skipped test is the non-hermetic #684 test that #711 fixes. |
The PR body says the Tauri crate tests weren't run. They have now been run, and pass (last row).
Merge order
Merge #703 first, then this PR. For the release, release/v0.70.0 takes both.
…rovenance and token totals (stacked on #703)
|
Adversarial validation passed at 66b6594 Scope: CLI provider history line with provenance (#708, upstream 0.61.0 steipete#3737), validated as merged into release/v0.70.0 (merge 66b6594 = merge of 3e403a6 into 084d019). Attacks (highest-risk semantics, from the merged tree):
No defects found. READY for the un-draft rule. |
Summary
codexbar usagetext output now shows provider-supplied history the way upstream 0.61.0 does: the source period, the provider's own spend total with its cost provenance (reported,estimated,includes estimates), and an input-plus-output token total. For OpenRouter Activity the line changes fromLast 30 days (UTC): $1.25to
Last 30 days (UTC): $1.25 (reported) · 15 tokensFound by the 0.60.4-0.69.0 port gap audit.
Upstream reference
52e951285(CLIRenderer.liveHistoryLine,CLICardsRenderer,Tests/CodexBarTests/CLILiveHistoryTests.swift).Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swiftat v0.61.0: any BYOK estimate makes the windowestimated, ormixedwhen metered spend is also present; otherwisevendor metered. Token total is prompt plus completion (reasoning stays a separate counter), fromopenrouter.js.UsageFormatter.tokenCountString(K/M/B, promoted at the point where the lower unit would round to 1000).Ported
CostSnapshotgains display-onlyhistory_tokensandprovenance(both#[serde(skip)], so thecostJSON contract is unchanged, matching upstream's "ordinary usage JSON retains its contract").cli/usage/render.rsrenders the history line foralways_visiblespend snapshots with no limit (the existing path). Other providers that use that path (Fireworks, Replicate, Typesafe) set neither field, so their output is unchanged.$0.00 (reported) · 0 tokens.Deferred
CLICardsRendererequivalent, so there is nothing to extend.CostSnapshot.usedis not optional here, so a tokens-only line with no amount cannot be modeled without a wider change. The renderer itself handles tokens whenever a provider supplies them.grok/local_sessions.rsis left as is.docs/description of the CLI line: not added; the CHANGELOG entry covers it.Validation
All with
cargo +1.98.0, E-core wrappers, slot-5:cargo fmt --all: cleancargo clippy --workspace --all-targets -- -D warnings: pass (both manifests)cargo test -p codexbar history: 39 passedcargo test -p codexbar(full): 2167 passed, 0 failed, 1 ignoredcli/usage_tests.rs(provenance labels, known zero, singular token, currency, token compaction boundaries, JSON contract unchanged) andproviders/openrouter/activity.rs(token total and provenance from upstream's three fixture scenarios, empty history, duplicate rows not double counted)Affected areas
codexbar usagetext output)UI proof
Not applicable (CLI text output only).