Skip to content

fix(usage): stop reporting unavailable model pricing as free - #111175

Merged
obviyus merged 18 commits into
openclaw:mainfrom
xydigit-zt:fix/usage-omit-cost-when-pricing-unknown
Sep 19, 2026
Merged

obviyus merged 18 commits into
openclaw:mainfrom
xydigit-zt:fix/usage-omit-cost-when-pricing-unknown

Conversation

@xydigit-zt

@xydigit-zt xydigit-zt commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Related: #106080

What Problem This Solves

Fixes: completions report $0 when model pricing is unavailable, while session usage can omit deliberately configured free prices.

User Impact

Plugin completions and normal agent results now omit unavailable costs instead of claiming free usage. Explicit operator zero pricing and provider-billed zero totals remain 0, and session logs and summaries agree. Recorded positive costs keep their request-time pricing. No configuration changes or migration are required.

Why This Change Was Made

Adapter-default zeros are not billing evidence. Cost reporting now uses the existing configured/catalog pricing resolver, preserves recorded cost evidence, and carries provider-billed provenance through a sum only when every contribution is billed. Empty cost objects and empty tier lists cannot establish a price by themselves.

Legacy run summaries that report a cost without token buckets still preserve an explicit zero. Unpriced adapter zeros accompanied by token usage remain unknown.

Recorded zero-cost components survive normalization and aggregation without inventing provider-billed provenance. Existing derived usage summaries refresh through their normal semantic cache revision; stored transcripts, database schemas, and retention are unchanged.

This reworks the earlier marker-based proposal for the current pricing rules established in #114060 and #133695. It does not add pricingUnavailable, change catalog eligibility, or treat every unmarked generated zero as a free price. Zero-only catalog placeholders remain unknown; authored overrides and authoritative native pricing retain their existing precedence. The broader pricing-cache/discovery issue is not claimed fixed.

Evidence

Reproduced on baseline 0b753f1e through a normally loaded plugin's api.runtime.llm.complete, a real loopback HTTP/SSE adapter, and the normal agent CLI—not injected normalized usage or fabricated transcript records.

Scenario Observed after the fix
No pricing, an empty cost object, or an empty tier list Completion cost omitted; these emitted 0 before
Configured rates with 1,000 input and 500 output tokens $0.002 preserved
Explicit operator free pricing 0 preserved, including session logs that omitted it before
Provider-billed 0, including a model with no configured rates 0 preserved
Static catalog rows without prices or with zero-only placeholders Cost omitted under existing catalog policy
Author-owned models.json override $0.004 honored; file bytes unchanged

Five normal agent runs also passed public log and fresh usage-summary checks. Unknown pricing counted one missing-cost entry; authored-free and billed-zero runs counted none. An unrelated public config mutation preserved the original omitted cost field rather than persisting materialized zeros.

A warm-cache upgrade kept the same configuration and transcript and made exactly one original model request. The old fresh rollup still marked a free-priced entry as missing; the corrected runtime naturally refreshed it to known 0, without deleting the cache or calling the model again.

  • Four targeted regressions failed on the original source for the expected reasons.
  • 164 focused pricing/runtime tests passed. After the final component-preservation and warm-cache corrections, 114 affected normalization, accumulator, estimator, and cache tests passed; unchanged proof was reused.
  • Scoped type-aware lint and the supported runtime build passed.
  • CI-exposed compatibility checks were corrected and passed: 30 focused consumer cases, the affected plugin test type graph, and the exact assertion-allowance shrink. No unrelated shard-budget change is included.

The provider responses were synthetic; this does not claim live vendor billing or budget-enforcement validation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 19, 2026, 4:10 PM ET / 20:10 UTC (Revision 27).

ClawSweeper review

What this changes

Distinguish unavailable model costs from confirmed zero costs across plugin completions, agent usage totals, and cached session reports.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix: current main still reports unpriced completion totals as zero and rejects configured free pricing in session reports. The revised branch addresses the prior concerns without introducing a pricing setting; no blocking correctness finding remains.

Priority: P2
Reviewed head: fb3e05cb6aea2f1250e741601211b3c5d85f7173

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant production-path observations, upgrade coverage, and no remaining actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied after-fix observations exercise the changed completion and accounting owners through a normally loaded plugin, real loopback HTTP/SSE transport, normal agent runs, and warm-cache refresh, demonstrating omitted unknown costs and preserved confirmed zeros; synthetic responses do not establish vendor billing accuracy.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied after-fix observations exercise the changed completion and accounting owners through a normally loaded plugin, real loopback HTTP/SSE transport, normal agent runs, and warm-cache refresh, demonstrating omitted unknown costs and preserved confirmed zeros; synthetic responses do not establish vendor billing accuracy.
Evidence reviewed 9 items Current main still needs the fix: Current main accepts every finite nonnegative cost.total as explicit completion cost, including adapter-default zero. Its session estimator separately rejects all-zero configured rates.
Latest release comparison: The inspected v2026.9.5 completion implementation also accepts an unqualified zero total; this behavior is not already fixed in the supplied latest release.
Shared pricing and recorded-cost contract: The branch preserves positive recorded charges, billed zeros, and zero totals with component evidence. Empty price objects and empty tier lists no longer establish pricing. Catalog eligibility remains owned by the unchanged model-catalog resolver; the current patch does not depend on a Codex protocol change.
Findings None None.
Security None None.

How this fits together

OpenClaw combines model token counts, recorded charges, and configured or catalog prices into usage reports. This change keeps those reports consistent across plugin results, agent accounting, and session summaries.

flowchart TD
  A[Model usage and recorded charges] --> C[Normalize cost evidence]
  B[Configured and eligible catalog prices] --> D[Resolve missing prices]
  C --> D
  D --> E[Plugin completion and agent totals]
  D --> F[Refresh session usage cache]
  F --> G[Session logs and summaries]
Loading

Before merge

  • Resolve merge risk (P1) - Third-party plugins that assumed costUsd was always numeric may need to handle omission for unavailable pricing; the field is already optional, and the corrected behavior is documented and exercised.
Agent review details

Security

None.

PR surface

Source +33, Tests +151, Docs +5, Other 0. Total +189 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 6 95 62 +33
Tests 8 168 17 +151
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 16 269 80 +189

Review metrics

Metric Value Why it matters
Production versus test growth Production +95/-62 (net +33); tests +168/-17 (net +151) Production growth carries cost evidence through existing owners while removing duplicate pricing checks; regression coverage exercises the affected consumers.
Cache compatibility 1 derived-cache revision: 5 → 6; 0 database schema changes Existing summaries rebuild through their normal refresh lifecycle without rewriting canonical transcripts.

Merge-risk options

Maintainer options:

  1. Accept the corrected optional-cost semantics (recommended)
    Retain the documented omission behavior and compatibility evidence rather than preserving an inaccurate zero for unknown pricing.

Technical review

Best possible solution:

Keep the existing optional-cost API and shared pricing owner, preserving recorded charges and authored free prices with the supplied fresh-run and warm-cache compatibility proof.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main source accepts adapter-default cost.total = 0 as explicit billing, and the supplied baseline loopback run reports that exact failure; this read-only review did not execute target code.

Is this the best way to solve the issue?

Yes. Reusing the existing pricing resolver and preserving recorded cost evidence repairs the consumer boundary without adding another pricing policy or configuration marker.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cc7e211d146f.

Labels

Label justifications:

  • P2: Incorrect cost availability affects usage reporting with a bounded accounting blast radius.
  • merge-risk: 🚨 compatibility: Plugin completion results can now omit costUsd where they previously emitted an unsupported zero.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied after-fix observations exercise the changed completion and accounting owners through a normally loaded plugin, real loopback HTTP/SSE transport, normal agent runs, and warm-cache refresh, demonstrating omitted unknown costs and preserved confirmed zeros; synthetic responses do not establish vendor billing accuracy.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied after-fix observations exercise the changed completion and accounting owners through a normally loaded plugin, real loopback HTTP/SSE transport, normal agent runs, and warm-cache refresh, demonstrating omitted unknown costs and preserved confirmed zeros; synthetic responses do not establish vendor billing accuracy.

Evidence

What I checked:

  • Current main still needs the fix: Current main accepts every finite nonnegative cost.total as explicit completion cost, including adapter-default zero. Its session estimator separately rejects all-zero configured rates. (src/plugins/runtime/runtime-llm.runtime.ts:203, cc7e211d146f)
  • Latest release comparison: The inspected v2026.9.5 completion implementation also accepts an unqualified zero total; this behavior is not already fixed in the supplied latest release. (src/plugins/runtime/runtime-llm.runtime.ts:203, ec9c1a13db89)
  • Shared pricing and recorded-cost contract: The branch preserves positive recorded charges, billed zeros, and zero totals with component evidence. Empty price objects and empty tier lists no longer establish pricing. Catalog eligibility remains owned by the unchanged model-catalog resolver; the current patch does not depend on a Codex protocol change. (src/utils/usage-format.ts:297, fb3e05cb6aea)
  • Existing optional plugin result: LlmCompleteUsage already declares costUsd optional. The added SDK documentation explains omission, explicit free rates, provider-billed zero, and preservation of recorded request costs. (src/plugins/runtime/types-core.ts:238, fb3e05cb6aea)
  • Cache upgrade follows the existing lifecycle: Semantic cache revision 6 causes old rollups to be rejected and rebuilt by the existing refresh owner. The projection regression verifies that revision-5 rows request refresh instead of serving stale pricing; canonical transcripts and database schemas are unchanged. (src/infra/session-cost-usage-rollup-codec.ts:7, fb3e05cb6aea)
  • Production-path and upgrade observations: The supplied complete PR body, captured under sourceRevision 959ddb7064081c1873cb976705ec2f4e13cf9da7e8641a64a3b3cbc6041c3f6d, reports a normally loaded plugin calling runtime.llm.complete through real loopback HTTP/SSE, five normal agent runs, fresh public summaries, and a warm-cache upgrade. Observations distinguish omitted cost from confirmed zero, preserve $0.002 configured pricing and a $0.004 authored override, and refresh the old rollup without another model request. Responses were synthetic; vendor billing and budget enforcement were explicitly excluded. (fb3e05cb6aea)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (26 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-16T16:15:23.801Z sha 9c36a5ed0880f51e5858eb0b0da79394daaa55e7 :: found issues before merge. :: [P1] Mark static missing-price catalogs as unavailable | [P1] Settle the public pricing-provenance contract
  • reviewed 2026-08-16T17:19:54.918Z sha 4396d3a1474a7474c9dd623ea4f779bd77bad670 :: found issues before merge. :: [P1] Mark missing static catalog prices as unavailable | [P1] Define the pricing-provenance config contract
  • reviewed 2026-08-16T18:20:02.002Z sha 4396d3a1474a7474c9dd623ea4f779bd77bad670 :: found issues before merge. :: [P1] Mark missing static catalog prices as unavailable | [P1] Settle the pricing-provenance configuration contract
  • reviewed 2026-08-16T20:31:24.775Z sha 4396d3a1474a7474c9dd623ea4f779bd77bad670 :: found issues before merge. :: [P1] Preserve unavailable pricing from static manifests | [P1] Define the pricing-provenance configuration contract
  • reviewed 2026-08-17T13:30:30.382Z sha 226c80d :: needs maintainer review before merge. :: none
  • reviewed August 20, 2026, 1:49 AM ET / 05:49 UTC sha unknown :: needs changes before merge. :: [P2] Keep pricing provenance out of author-owned models.json
  • reviewed September 5, 2026, 4:00 AM ET / 08:00 UTC sha unknown :: blocked before merge. :: [P1] Preserve nonzero transport-calculated costs
  • reviewed 2026-09-19T19:06:48.530Z sha 59b6bf8 :: blocked before merge. :: none

@xydigit-zt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@xydigit-zt
xydigit-zt force-pushed the fix/usage-omit-cost-when-pricing-unknown branch from a71a6c7 to 378a93c Compare August 3, 2026 14:16
@xydigit-zt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 3, 2026
thomas.szbay added 12 commits August 17, 2026 20:15
The runtime-llm test file exceeded the 1000-line lint cap; move the
three pricing-provenance cases (unavailable / marked placeholder-zero /
confirmed zero) into runtime-llm.usage-pricing.test.ts with their own
minimal mock wiring.
…umers

Review finding: runtime completion and session aggregation disagreed on
unmarked all-zero pricing (known /bin/bash vs missing). Align both on the same
provenance contract: pricing is unknown only when no cost config exists
or it is explicitly marked pricingUnavailable; unmarked all-zero is a
confirmed /bin/bash (Ollama explicit free pricing, user-configured zeros).

Includes exact-head live proof over real HTTP (local OpenAI-compatible
SSE endpoint): unknown/confirmed-free/marked/provider-billed.
Direct estimateUsageCost consumers (response usage lines, status,
diagnostics) bypassed the two local isModelPricingKnown guards and still
turned marked placeholder zeros into a confident $0. Move the check into
the shared estimator: marked pricing now yields no estimate everywhere.

- estimateUsageCost returns undefined for pricingUnavailable
- contract test: live-discovered Codex models without manifest pricing
  carry the pricingUnavailable marker
- direct-estimator cases added to the exact-head live proof
- correct the runtime-llm comment to document the unified contract
resolveModelCost rebuilt the cost object with only numeric rates and
tiers, silently dropping pricing provenance during ordinary config
materialization and turning marked placeholder pricing back into a
confident $0 before runtime use. Preserve the marker, add a
materialization regression, and export buildOpenAICodexLiveProviderConfig
(module-local) so the contract test and producer-to-runtime proof can
exercise the real discovery path.
…gh defaults

The model schema permits an omitted or empty cost block, but applyModelDefaults filled all-zero rates without the pricingUnavailable marker, so the known-pricing predicate reclassified those models as a confident $0. resolveModelCost now treats a cost block with no configured rates (omitted, empty, or marker-free) as unknown pricing; explicit all-zero and partial-rate blocks stay known. Covers the runtime completion and session rollup paths.
ModelDefinitionConfig types cost as required (the post-materialization shape), while the zod schema and real configs allow omitting it; the pre-materialization fixture needs the cast so tsgo test-types accepts the omitted-cost case.
Normalization drops an empty tier list, so cost: { tieredPricing: [] } carries no rates; counting it as configured let the materialized all-zero defaults through as a confident $0. The configured-rate check now requires a non-empty tier list.
…producers

Manifest catalog rows without rates (e.g. the claude-cli rows in
extensions/anthropic/openclaw.plugin.json) were materialized as unmarked
all-zero costs by both static producers, so usage reporting treated them
as a confident $0. cloneManifestCatalogCost and
modelDefinitionCostFromManifestRow now mark rate-less rows
pricingUnavailable, matching the catalog-owned provenance contract, and
the usage boundary omits their cost. Explicit all-zero manifest pricing
stays unmarked as confirmed free.
…config

The provenance marker is runtime/catalog metadata produced by catalog
producers and model defaulting; it never shipped as an operator setting.
Remove it from the strict user model-cost schema: unknown pricing in
user config is expressed structurally by omitting cost rates, and
applyModelDefaults derives the marker. models.json keeps carrying the
marker (its TypeBox schema allows the extra key and Check() does not
strip it).
@xydigit-zt
xydigit-zt force-pushed the fix/usage-omit-cost-when-pricing-unknown branch from 4396d3a to 226c80d Compare August 17, 2026 13:18
@xydigit-zt

Copy link
Copy Markdown
Contributor Author

Both P1 findings are addressed on the rebased head (226c80d0160):

1. Preserve unavailable pricing from static manifests — fixed at the shared producer. cloneManifestCatalogCost (src/plugin-sdk/provider-catalog-shared.ts) and modelDefinitionCostFromManifestRow (src/plugins/provider-discovery.runtime.ts) now mark a manifest row with no rates (no flat rates, no non-empty tieredPricing) as pricingUnavailable: true, so the Claude CLI rows (which omit cost) and tencent-tokenplan/hy3 carry unknown-pricing provenance through models.json to the usage boundary instead of reporting a confident $0. Explicit all-zero manifest pricing stays unmarked (confirmed free). Covered by new regression tests at both producers and through the usage boundary (resolveModelCostConfig → estimateUsageCost), each verified to fail on the pre-fix code, plus a real-runtime proof driven from the actual bundled Anthropic manifest (terminal output in the PR body's "Static-manifest proof" block: producer emits the marker, runtime omits costUsd; the explicit-zero counter-case keeps costUsd: 0).

2. Pricing-provenance configuration contract — resolved per the review's recommendation: provenance is catalog-owned. pricingUnavailable is removed from the strict user model-cost zod schema and remains only on the runtime/catalog type. User config expresses unknown pricing structurally by omitting cost rates; applyModelDefaults derives the marker during materialization. The marker's one legitimate persistence surface is models.json (written from producer output): its TypeBox schema accepts the extra key — verified against the repo's pinned typebox 1.3.6 (Compile(...).Check() passes extra keys and does not strip), and the usage cost index reads models.json as raw JSON with no stripping schema. No write path persists catalog-derived model entries into openclaw.json, so strict user-config validation is unaffected (full src/config/ suite: 3325 passed).

Codex dependency contract — directly inspected in the sibling ../codex checkout at main (4885eb6): the /models response ModelsResponse (codex-rs/protocol/src/openai_models.rs:627-634) carries Vec<ModelInfo>, and ModelInfo (openai_models.rs:372-461, documented as "Model metadata returned by the Codex backend /models endpoint") contains no pricing/rate/cost fields — only identity, reasoning, capability, context-window, and service-tier label metadata (ModelServiceTier is {id, name, description}). This confirms the "codex model/list exposes no per-token price" premise behind the placeholder-zero marking.

Also on this push: rebased onto latest main (the head was reported conflicting). The boundary-artifacts freshness commit was dropped because main replaced the hardcoded PLUGIN_SDK_TYPE_INPUTS list with build-info-derived inputs, which subsumes it.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

obviyus and others added 3 commits September 19, 2026 23:46
Use existing configured and eligible catalog prices instead of treating
adapter-default zeros as billing evidence. Preserve explicit free rates,
recorded costs, and provider-billed provenance across complete billed sums.
Keep authored model files and config omission unchanged; introduce no new
pricing marker or catalog policy.

Rework the original proposal against current pricing owners while retaining
its contributor ancestry and reproducing the public completion and usage paths.

Co-authored-by: thomas.szbay <[email protected]>
…orts

Retain existing nonzero cost components as zero-total evidence through
normalization and complete recorded sums, without labeling mixed usage as
provider-billed. Rebuild derived usage rollups through their existing
semantic revision so warm cached summaries observe corrected free pricing.
Canonical transcripts, database schemas, and retention are unchanged.

Co-authored-by: thomas.szbay <[email protected]>
…ecks

Keep explicit aggregate costs when token buckets are unavailable without
restoring unpriced adapter zeros accompanied by token usage. Preserve truthful
billed provenance and configured-free reporting in existing consumer tests.
Use a supported model API in the pricing fixture, remove the incidental cache
revision assertion, and shrink the allowance for the three removed casts.

Co-authored-by: thomas.szbay <[email protected]>
@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Merged as c188f65.

Unavailable pricing is no longer presented as free usage. Authored free prices, provider-billed zeros, recorded cost evidence, and legacy billing-only summaries are preserved; existing usage caches refresh through their normal owner.

Verified with real loaded-plugin and agent flows through loopback HTTP/SSE, public usage summaries, and a warm-cache upgrade without another model call. Exact-head review was clean, and PR CI completed successfully (151 passed, 16 skipped).

Thanks @xydigit-zt for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants