Skip to content

feat(pricing): add runtime pricing overrides#1204

Merged
ryoppippi merged 4 commits into
ryoppippi:mainfrom
xiaoMaJia707:feat/pricing-overrides
Jun 8, 2026
Merged

feat(pricing): add runtime pricing overrides#1204
ryoppippi merged 4 commits into
ryoppippi:mainfrom
xiaoMaJia707:feat/pricing-overrides

Conversation

@xiaoMaJia707

@xiaoMaJia707 xiaoMaJia707 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Add per-model pricing overrides via ccusage.json. Useful when a model is missing from the embedded LiteLLM snapshot (private deployments, internal wrappers like Pi's [pi] gpt-5.4, custom proxies) or when the snapshot price differs from your contract.

Config under defaults.pricingOverrides, keyed by raw model name (with adapter prefix where applicable):

{
  "defaults": {
    "pricingOverrides": {
      "[pi] gpt-5.4": {
        "inputCostPerToken": 0.0000025,
        "outputCostPerToken": 0.000015,
        "cacheReadInputTokenCost": 0.00000025
      }
    }
  }
}

Supported fields: input/output cost, cache create/read cost, tiered above-200k variants, maxInputTokens (statusline context limit), and fastMultiplier. Unspecified fields fall back to the existing LiteLLM entry or 0.0 for new models. Overrides apply in both online and --offline modes; the two flags are orthogonal (--offline controls the data source, pricingOverrides patches specific entries).

Behavior fix: the Pi adapter parser previously took usage.cost.total verbatim and ignored CostMode. It now goes through calculate_cost_for_usage, so Auto/Calculate modes recompute from tokens and pricingOverrides apply to Pi entries.

Implementation:

  • PricingMap::load_with_overrides plumbs overrides through every adapter (claude, codex, opencode, qwen, pi, all/loader, statusline hook).
  • apply_override merges over existing entries, preserving fields the user did not specify; sets cache_read_explicit when cache_read is explicitly provided; writes maxInputTokens to context_limits.
  • Cache scaling: apply_override scales implicit cache values proportionally when input cost is overridden and cache_read_explicit is false.
  • Config merge: merge_pricing_overrides now does field-level merge (child config only overwrites fields it explicitly sets, preserving parent fields for the same model).
  • Pi missing_pricing_model: Pi adapter now calls missing_pricing_model_for_usage so users get a warning when a model has no pricing data in Calculate/Auto modes.
  • Schema: ConfigPricingOverride exposed via JSON schema with snapshot test covering all fields.
  • Docs: docs/guide/config-files.md gains a Pricing Overrides section (raw model name convention, supported fields, offline-vs-overrides); cost-modes.md cross-links it.

Tests: ~13 unit tests covering apply_override (full / partial / cache_read explicit semantics / max_input_tokens write / preserves existing limit / cache proportional scaling / zero-cache no-scale / explicit cache precedence), config field-level merge (parent preserved / child override), Pi missing_pricing_model (Calculate warns / Display silent / Auto+cost silent); statusline context_window_size test now uses a pricingOverrides fixture for a deterministic assert_eq instead of

= 200_000.


Summary by cubic

Add runtime per-model pricing overrides to set accurate token costs and context limits without rebuilding. Also fix the Pi and OpenClaw adapters to honor cost modes and overrides, and ensure statusline totals respect overrides.

  • New Features

    • Add defaults.pricingOverrides in ccusage.json, keyed by raw model name (include adapter prefixes like [pi] gpt-5.4 or [openclaw] gpt-5.2).
    • Supports input/output costs, cache create/read, 200k+ tiers, maxInputTokens (used by statusline), and fastMultiplier. Unspecified fields fall back to LiteLLM or 0.0. Works both online and with --offline. Parent/child configs merge per field.
    • Cache scaling: if only input cost is overridden, implicit cache prices scale proportionally; explicit cache values are preserved.
    • Schema and docs updated; example config added.
  • Bug Fixes

    • Pi parser routes cost through calculate_cost_for_usage: Auto/Calculate recompute from tokens, Display keeps provided totals. Overrides now affect Pi logs and warnings fire only when needed.
    • OpenClaw now applies cost modes and pricing overrides consistently; keeps embedded display cost while recomputing reported cost when needed. Overrides flow through status and session paths.
    • Statusline “today” totals now carry pricingOverrides so totals match session/context calculations.

Written for commit d89bed3. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Custom Pricing Overrides: per-model token pricing (including tiered rates, cache costs, context limits, and fast multiplier) configurable via ccusage.json and applied in both online and offline modes.
  • Documentation

    • README updated with Custom Pricing Overrides note
    • Added detailed Pricing Overrides guide with examples and key-matching rules
    • cost-modes guide updated
    • Example config now includes pricingOverrides sample

Add per-model pricing overrides via ccusage.json. Useful when a model is
missing from the embedded LiteLLM snapshot (private deployments, internal
wrappers like Pi's `[pi] gpt-5.4`, custom proxies) or when the snapshot
price differs from your contract.

Config under defaults.pricingOverrides, keyed by raw model name (with
adapter prefix where applicable):

    {
      "defaults": {
        "pricingOverrides": {
          "[pi] gpt-5.4": {
            "inputCostPerToken": 0.0000025,
            "outputCostPerToken": 0.000015,
            "cacheReadInputTokenCost": 0.00000025
          }
        }
      }
    }

Supported fields: input/output cost, cache create/read cost, tiered
above-200k variants, maxInputTokens (statusline context limit), and
fastMultiplier. Unspecified fields fall back to the existing LiteLLM
entry or 0.0 for new models. Overrides apply in both online and
--offline modes; the two flags are orthogonal (--offline controls the
data source, pricingOverrides patches specific entries).

Behavior fix: the Pi adapter parser previously took usage.cost.total
verbatim and ignored CostMode. It now goes through
calculate_cost_for_usage, so Auto/Calculate modes recompute from tokens
and pricingOverrides apply to Pi entries.

Implementation:
- PricingMap::load_with_overrides plumbs overrides through every adapter
  (claude, codex, opencode, qwen, pi, all/loader, statusline hook).
- apply_override merges over existing entries, preserving fields the
  user did not specify; sets cache_read_explicit when cache_read is
  explicitly provided; writes maxInputTokens to context_limits.
- Cache scaling: apply_override scales implicit cache values
  proportionally when input cost is overridden and cache_read_explicit
  is false.
- Config merge: merge_pricing_overrides now does field-level merge
  (child config only overwrites fields it explicitly sets, preserving
  parent fields for the same model).
- Pi missing_pricing_model: Pi adapter now calls
  missing_pricing_model_for_usage so users get a warning when a model
  has no pricing data in Calculate/Auto modes.
- Schema: ConfigPricingOverride exposed via JSON schema with snapshot
  test covering all fields.
- Docs: docs/guide/config-files.md gains a Pricing Overrides section
  (raw model name convention, supported fields, offline-vs-overrides);
  cost-modes.md cross-links it.

Tests: ~13 unit tests covering apply_override (full / partial /
cache_read explicit semantics / max_input_tokens write / preserves
existing limit / cache proportional scaling / zero-cache no-scale /
explicit cache precedence), config field-level merge (parent preserved /
child override), Pi missing_pricing_model (Calculate warns / Display
silent / Auto+cost silent); statusline context_window_size test now uses
a pricingOverrides fixture for a deterministic assert_eq instead of
>= 200_000.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This PR was auto-closed. Only contributors approved with lgtm can open PRs. Open an issue first.

Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.

If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

See CONTRIBUTING.md.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4458d480-feda-4fa4-a644-d0c472b836d5

📥 Commits

Reviewing files that changed from the base of the PR and between cf2d7cd and d89bed3.

⛔ Files ignored due to path filters (1)
  • rust/crates/ccusage/src/snapshots/ccusage__config_schema__tests__snapshots_schema_agent_specific_option_edges.snap is excluded by !**/*.snap
📒 Files selected for processing (33)
  • apps/ccusage/README.md
  • apps/ccusage/config-schema.json
  • ccusage.example.json
  • docs/guide/config-files.md
  • docs/guide/cost-modes.md
  • rust/crates/ccusage-cli/src/lib.rs
  • rust/crates/ccusage-cli/src/types.rs
  • rust/crates/ccusage/src/adapter/all/loader.rs
  • rust/crates/ccusage/src/adapter/amp/mod.rs
  • rust/crates/ccusage/src/adapter/claude/daily.rs
  • rust/crates/ccusage/src/adapter/claude/mod.rs
  • rust/crates/ccusage/src/adapter/codebuff/mod.rs
  • rust/crates/ccusage/src/adapter/codex/mod.rs
  • rust/crates/ccusage/src/adapter/copilot/mod.rs
  • rust/crates/ccusage/src/adapter/droid/mod.rs
  • rust/crates/ccusage/src/adapter/gemini/mod.rs
  • rust/crates/ccusage/src/adapter/goose/mod.rs
  • rust/crates/ccusage/src/adapter/hermes/mod.rs
  • rust/crates/ccusage/src/adapter/kilo/mod.rs
  • rust/crates/ccusage/src/adapter/kimi/mod.rs
  • rust/crates/ccusage/src/adapter/openclaw/loader.rs
  • rust/crates/ccusage/src/adapter/openclaw/mod.rs
  • rust/crates/ccusage/src/adapter/openclaw/parser.rs
  • rust/crates/ccusage/src/adapter/opencode/loader.rs
  • rust/crates/ccusage/src/adapter/pi/loader.rs
  • rust/crates/ccusage/src/adapter/pi/mod.rs
  • rust/crates/ccusage/src/adapter/pi/parser.rs
  • rust/crates/ccusage/src/adapter/qwen/parser.rs
  • rust/crates/ccusage/src/commands/mod.rs
  • rust/crates/ccusage/src/config.rs
  • rust/crates/ccusage/src/config_schema.rs
  • rust/crates/ccusage/src/main.rs
  • rust/crates/ccusage/src/pricing.rs

📝 Walkthrough

Walkthrough

This PR adds configurable per-model pricing overrides to ccusage, introducing runtime and config types for overrides, refactors PricingMap into load_with_overrides/apply_overrides, threads overrides into loaders/parsers/adapters/statusline, updates config schema and merge logic, and adds docs and tests.

Changes

Pricing Overrides Configuration and Application

Layer / File(s) Summary
Pricing override types, CLI, and schema
rust/crates/ccusage-cli/src/types.rs, rust/crates/ccusage-cli/src/lib.rs, rust/crates/ccusage/src/config_schema.rs, ccusage.example.json, apps/ccusage/README.md, docs/guide/config-files.md, docs/guide/cost-modes.md
Adds PricingOverride and ConfigPricingOverride types, exposes pricing_overrides: BTreeMap<String, PricingOverride> on SharedArgs, includes pricingOverrides in schema/example, and documents usage (raw model-name keys, supported fields, offline independence).
PricingMap core refactor & apply_overrides
rust/crates/ccusage/src/pricing.rs
Replaces PricingMap::load with load_with_overrides, adds Pricing::empty(), and implements apply_overrides/apply_override with proportional cache-scaling, explicit cache-read precedence, above-200k tier handling, and context-limit writes; adds thorough override tests.
Config loading and merge semantics
rust/crates/ccusage/src/config.rs
Parses pricingOverrides from config into runtime map and merges per-model overrides into shared.pricing_overrides with field-level conditional overwrites; adds From and unit tests for merge behavior.
OpenClaw & PI loaders/parsers: pricing-aware loading and cost computation
rust/crates/ccusage/src/adapter/openclaw/{loader.rs,parser.rs}, rust/crates/ccusage/src/adapter/pi/{loader.rs,parser.rs,mod.rs}
Extend loader APIs and session parsers to accept optional PricingMap, compute costs via calculate_cost_for_usage, set missing_pricing_model flags, thread pricing through loading pipelines, and add tests asserting pricing-overrides-driven cost computations.
Adapter integration (all adapters)
rust/crates/ccusage/src/adapter/{amp,claude,codebuff,codex,copilot,droid,gemini,goose,hermes,kilo,kimi,opencode,qwen,pi}/mod.rs, rust/crates/ccusage/src/adapter/claude/daily.rs, rust/crates/ccusage/src/adapter/opencode/loader.rs
Systematically switches adapters to PricingMap::load_with_overrides(...) and supplies shared.pricing_overrides so overrides are applied during adapter pricing initialization and entry summarization.
All loader/session aggregation refactor
rust/crates/ccusage/src/adapter/all/loader.rs
load_rows and session-capable loader plumbing updated to accept and thread pricing maps; Claude session handling inlined and the local summarize_entries helper removed.
Statusline context window: pricing override application
rust/crates/ccusage/src/commands/mod.rs
calculate_context_tokens_from_transcript now accepts SharedArgs, lazily loads PricingMap with overrides, and uses per-model context_limit when computing transcript context windows; tests updated to verify override behavior.
Tests, examples, docs, and minor formatting
rust/crates/ccusage/src/main.rs, rust/crates/ccusage-cli/src/lib.rs, ccusage.example.json, apps/ccusage/README.md, docs/guide/*
Update tests for new function signatures, add example pricingOverrides, update README/docs with Pricing Overrides guide, and perform small formatting changes in CLI re-exports.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

"A rabbit's nibble on configs, crisp and neat,
Per-model pricing baked, no more defeat.
Cache costs scaled and context windows tuned,
Adapters lined up, overrides are hewn.
Hop, test, and doc — the patch is sweet!"

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@ryoppippi

Copy link
Copy Markdown
Owner

@coderabbitai @pullfrog review this

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== pricing.rs (key sections) ==="
cat rust/crates/ccusage/src/pricing.rs | head -300

echo ""
echo "=== pricing.rs apply_override section ==="
grep -n "apply_override\|cache_read_explicit\|proportional\|load_with_overrides\|empty" rust/crates/ccusage/src/pricing.rs | head -80

echo ""
echo "=== config.rs merge sections ==="
grep -n "merge_pricing_overrides\|merge_override_fields\|apply_shared_options\|From<ConfigPricingOverride" rust/crates/ccusage/src/config.rs | head -40

echo ""
echo "=== config_schema.rs ConfigPricingOverride ==="
grep -n "ConfigPricingOverride\|pricing_overrides\|pricingOverrides" rust/crates/ccusage/src/config_schema.rs | head -40

echo ""
echo "=== pi/parser.rs key changes ==="
grep -n "calculate_cost_for_usage\|missing_pricing_model\|display_cost\|cost_usd\|CostMode" rust/crates/ccusage/src/adapter/pi/parser.rs | head -40

echo ""
echo "=== commands/mod.rs statusline context ==="
grep -n "calculate_context_tokens\|load_with_overrides\|context_window_size\|context_limit" rust/crates/ccusage/src/commands/mod.rs | head -40

echo ""
echo "=== types.rs PricingOverride ==="
cat rust/crates/ccusage-cli/src/types.rs

echo ""
echo "=== Full pricing.rs apply_override function ==="
sed -n '/fn apply_override/,/^    }/p' rust/crates/ccusage/src/pricing.rs | head -120

echo ""
echo "=== config.rs merge functions ==="
sed -n '/fn merge_pricing_overrides/,/^}/p' rust/crates/ccusage/src/config.rs | head -80
sed -n '/fn merge_override_fields/,/^}/p' rust/crates/ccusage/src/config.rs | head -40

Length of output: 33807


🏁 Script executed:

#!/bin/bash
echo "=== Full pricing.rs ==="
cat rust/crates/ccusage/src/pricing.rs

echo ""
echo "=== Full config.rs (last 200 lines) ==="
tail -200 rust/crates/ccusage/src/config.rs

echo ""
echo "=== Full pi/parser.rs ==="
cat rust/crates/ccusage/src/adapter/pi/parser.rs

echo ""
echo "=== Full commands/mod.rs ==="
cat rust/crates/ccusage/src/commands/mod.rs

echo ""
echo "=== config_schema.rs relevant sections ==="
grep -n -A 30 "ConfigPricingOverride" rust/crates/ccusage/src/config_schema.rs | head -80
grep -n -A 20 "pricing_override_map_option" rust/crates/ccusage/src/config_schema.rs | head -40

echo ""
echo "=== ccusage.example.json ==="
cat ccusage.example.json

echo ""
echo "=== docs/guide/config-files.md (new section) ==="
grep -n -A 60 "Pricing Override" docs/guide/config-files.md | head -80

Length of output: 120748



@ryoppippi — thorough, well-structured PR. The core override mechanics look solid. Here are my findings:


Review of PR #1204

✅ Strengths

apply_override logic (pricing.rs) is well-designed:

  • Division-by-zero is guarded (base.input > 0.0 before computing scale)
  • Proportional cache scaling only applies when !cache_read_explicit (LiteLLM-derived values), correctly preserving independently-set prices
  • Explicit cache override fields always take precedence over scaled values
  • Zero-value cache fields are not scaled (preserves 0.0 for no-cache models)
  • Above-200k variants are also scaled proportionally — good catch

merge_override_fields / merge_pricing_overrides field-level merging is correct: child configs only write fields that are explicitly Some(...), parent fields are preserved.

Pi behavior fix (routing through calculate_cost_for_usage instead of usage.cost.total) is a meaningful correctness improvement.

Test coverage is comprehensive — proportional scaling, explicit override precedence, cache_read_explicit flag semantics, config merge hierarchy, and Pi missing_pricing_model warnings are all exercised.


⚠️ Issues

1. Statusline context window ignores config pricing overrides

In run_statusline, the shared that reaches calculate_context_tokens_from_transcript is built with empty pricing_overrides:

// commands/mod.rs
let shared = SharedArgs {
    offline: args.offline && !args.no_offline,
    ..SharedArgs::default()   // pricing_overrides = BTreeMap::new()
};

StatuslineArgs has no pricing_overrides field, and apply_config_to_statusline_args (which operates on StatuslineArgs) never populates the SharedArgs. So if a user sets maxInputTokens via pricingOverrides in ccusage.json, it will work for all agent commands (which go through SharedArgs config loading) but not for the statusline's context window percentage.

The unit test uses_model_context_limit_for_transcript_context_tokens passes because it manually injects pricing_overrides into a local SharedArgs — it doesn't exercise the production path from run_statusline.

To fix: StatuslineArgs would need a pricing_overrides field (or a SharedArgs snapshot) populated from config during startup, then threaded through run_statuslinerender_statuslinecalculate_context_tokens_from_transcript.

2. ConfigPricingOverride may be missing #[serde(rename_all = "camelCase")]

The example JSON (and docs) use camelCase field names (inputCostPerToken, cacheReadInputTokenCost, etc.), but the struct at config_schema.rs Line 523 uses snake_case field names:

pub(crate) struct ConfigPricingOverride {
    pub(crate) input_cost_per_token: Option<f64>,
    pub(crate) cache_read_input_token_cost: Option<f64>,
    ...
}

If the struct lacks #[serde(rename_all = "camelCase")], serde_json::from_value(...).ok() in pricing_override_map_option will silently return None for every field — all overrides would be quietly ignored. Can you confirm this attribute is present? (It doesn't appear in the grep output.)


Minor notes

  • merge_override_fields is verbose but readable. A macro_rules! could reduce repetition if more fields are added later, but it's not necessary now.
  • Pricing::empty() as const fn is a clean approach for new model seeding.
  • The PricingMap::load removal is a clean internal API simplification since it's pub(crate).
  • Documentation (config-files.md) is well-written: the adapter prefix table and "Overrides vs Offline Mode" section are especially useful.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two rough edges worth a look.

Reviewed changes — adds per-model pricing overrides via ccusage.json, fixes the Pi adapter to respect CostMode, and plumbs overrides through all adapters including the statusline hook.

  • Add PricingOverride / ConfigPricingOverride types — user-facing config struct with camelCase field names, internal struct with snake_case; field-level merge preserves parent fields in child config resolution.
  • Rename PricingMap::load to load_with_overrides — every adapter (amp, claude, codebuff, codex, copilot, droid, gemini, goose, hermes, kilo, kimi, opencode, pi, qwen) now passes shared.pricing_overrides.iter().
  • Implement apply_overrides — merges user prices onto LiteLLM entries with proportional cache scaling when only input cost is overridden; sets context_limits for maxInputTokens; division-by-zero guarded by base.input > 0.0 check; cache_read_explicit flag prevents double-scaling of independently-set cache values.
  • Fix Pi adapter cost calculation — parser now routes through calculate_cost_for_usage so Auto/Calculate modes recompute from tokens and overrides apply; adds missing_pricing_model warnings matching other adapters.
  • Update statusline hookcalculate_context_tokens_from_transcript now loads pricing with overrides for context window size via maxInputTokens.
  • Schema and docspricingOverrides exposed in JSON schema, new Config Files docs section with raw model name convention and supported fields table, updated cost-modes.md cross-link, updated example config and schema snapshot.
  • Fix enable_models_dev_fallback — changed from always true to !offline, preventing network fetches in offline mode.

⚠️ OpenClaw adapter does not consume pricing overrides

All 14 other adapters pass shared.pricing_overrides.iter() to PricingMap::load_with_overrides, but the openclaw adapter takes no pricing parameter. In all/loader.rs, openclaw uses load_summary_agent_rows (which receives no pricing) while pi uses load_session_capable_summary_agent_rows (which does). Overrides won't apply to openclaw entries — most visible for maxInputTokens, which can't be set for openclaw models.

Technical details
## Affected sites
- `rust/crates/ccusage/src/adapter/openclaw/loader.rs:10``load_entries` takes no `PricingMap`
- `rust/crates/ccusage/src/adapter/openclaw/parser.rs:31``parse_session_file` takes no pricing parameter
- `rust/crates/ccusage/src/adapter/all/loader.rs:162-172` — openclaw dispatched via `load_summary_agent_rows`, no pricing threaded through
- `rust/crates/ccusage/src/adapter/openclaw/mod.rs` — no `PricingMap::load_with_overrides` call

## Required outcome
- Either thread `PricingMap` through openclaw's loader/parser (mirroring the pi pattern) or explicitly document that openclaw skips overrides because its entries carry embedded display costs.

## Suggested approach
Add `cost_mode: CostMode` and `pricing: Option<&PricingMap>` to `openclaw::load_entries` and `parse_session_file`, call `calculate_cost_for_usage` + `missing_pricing_model_for_usage` in the parser, and load pricing via `PricingMap::load_with_overrides` in `mod.rs::run`.

ℹ️ statusline_today_shared resets pricing_overrides to empty

The statusline's "today" cost path creates a minimal SharedArgs via statusline_today_shared with ..SharedArgs::default(), which drops any user-configured pricingOverrides. Since the per-agent loader recomputes costs from a fresh PricingMap::load_with_overrides each time, today-cost entries loaded under this empty-override SharedArgs won't reflect user pricing patches. The session cost and context-limit paths are unaffected — they use the outer shared that carries the overrides.

Technical details
## Affected sites
- `rust/crates/ccusage/src/commands/mod.rs:524``..SharedArgs::default()` in `statusline_today_shared` resets `pricing_overrides`
- `rust/crates/ccusage/src/commands/mod.rs:415``load_entries(&today_shared, None)` uses the reset struct for today-cost computation

## Required outcome
- Propagate `pricing_overrides` into the `statusline_today_shared` SharedArgs: `pricing_overrides: shared.pricing_overrides.clone()`

## Open questions for the human
- Is the today-cost feature important enough to warrant the fix now, or is it acceptable to defer? The session and context-limit paths already work correctly with overrides.

Pullfrog  | Fix it ➔View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

ryoppippi added 3 commits June 8, 2026 22:14
Thread the PR pricing map into the OpenClaw adapter so Calculate mode and per-model pricingOverrides are applied consistently with the other usage adapters. Preserve embedded display costs on each entry while deriving the reported cost from the selected CostMode, which keeps Display and Auto behavior intact and allows overrides to drive recalculation.

Also carry pricingOverrides into the statusline today-cost SharedArgs. Without this, statusline session/context calculations used overrides but the today total recomputed entries with an empty override map.
# Conflicts:
#	rust/crates/ccusage-cli/src/types.rs
#	rust/crates/ccusage/src/config_schema.rs
Apply the formatting that the pre-push treefmt hook requires after merging the latest main branch into the pricing overrides PR.
@ryoppippi ryoppippi merged commit 199ee29 into ryoppippi:main Jun 8, 2026
3 of 4 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.

2 participants