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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).