Skip to content

fix(models): refresh native pricing without pinning defaults - #133695

Merged
steipete merged 2 commits into
mainfrom
fix/native-pricing-authored-costs-20260830
Aug 31, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/native-pricing-authored-costs-20260830

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #133349 — merged cached long-context accounting and custom tier support.
Related: #129694 — merged Venice runtime pricing repair that prevents zero overwrites.
Related: #113549 — open OpenCode/Go catalog drift tracker; this change addresses pricing only and does not close its broader ID, context, or hybrid-refresh scope.

Additional instructions

This is a same-repository maintainer branch; maintainers can update it.

What Problem This Solves

Fixes an issue where users relying on native Venice, OpenCode, or OpenRouter prices could see stale or incomplete cost estimates, and users changing unrelated model settings could accidentally pin generated prices instead of receiving later catalog prices. Explicit partial or zero prices could also disagree between model preparation and usage reporting.

This is a maintainer-requested follow-up to the accounting and Venice runtime repairs linked above. Before this change, generated defaults could become indistinguishable from authored prices while moving through preparation and runtime resolution. Afterward, raw authored costs retain their authority and native catalog prices can refresh wherever the user has not authored a price override.

Why This Change Was Made

Venice's plugin-owned pricing-api.ts reads the existing cached /models response and is reused by the shared catalog publisher. A closed native-source registry and shared complete-schedule normalization handle OpenCode, Venice, and the existing sibling pricing paths without grafting base prices and tiers from different sources. Venice's whole-request extended rates begin strictly above the API threshold, including cached prompt tokens.

Authored costs are merged before materialized defaults across worker source capture, both preparation passes, final model resolution, and usage lookup. First-authored duplicate-row and canonical provider spelling precedence agree across those owners. Redundant source-context state and overlapping lookup/index refresh machinery are removed. Adding a downstream reporting guard would leave the preparation owner incorrect; guessing a migration from serialized price values would risk overwriting real user choices.

Display-only lookups merge prepared runtime prices below raw authored overrides without plugin discovery or network access. Valid native free schedules require an enabled owner-normalized authoritative-source policy and an exact hosted owner key; unknown zero seeds, non-authoritative zeros, aliases, disabled/unowned policy, and private endpoints remain unknown. The publisher and resolver share one source registry.

OpenRouter static overrides compile complete schedules from the same native base: thresholds are strictly greater than min_prompt_tokens, with integer boundaries at floor(N)+1; matching rows apply in source order per price key. Omitted fields inherit, equal thresholds and explicit zero work, and UTC/unknown predicates are excluded. The generic calculator and Venice/OpenCode boundary semantics are unchanged.

There is no new operator option, dependency, pricing store, SQLite schema, protocol version, or inference-time pricing HTTP request. The authoritative publisher refuses failed native pricing instead of replacing output; runtime retains its existing offline seed behavior.

User Impact

Venice and OpenCode estimates can use current complete native schedules, including cache rates and long-context tiers. Fresh Venice onboarding in merge mode avoids writing generated price pins; replace mode retains its explicit seed. Explicit zero, partial, flat, tiered, and agent-local models.json prices remain authoritative. Empty authored cost inherits the applicable schedule; a flat authored cost removes inherited tiers.

Existing serialized costs remain explicit because historical authorship cannot be inferred safely. Copying an entire materialized model array back into config retains the documented authorship limitation. Historical unbilled tiered estimates can still be repriced under the existing policy; provider-billed totals remain authoritative. UTC scheduling and OpenRouter’s existing capability-cache lifecycle are unchanged. The updated model, provider, manifest, and token-use docs describe these boundaries.

Release-note context: refresh native Venice/OpenCode pricing without pinning generated defaults, while preserving user-authored prices through preparation and reporting.

Evidence

Current repair commit: a419204e942. All eleven final repair file hashes and the full local diff SHA-256 366b16a875ca98872ebd233673b51a6ed0d56600a622bfbd726048a35f2e5d07 matched the parent-verified candidate before staging; all hashes were rechecked after the normal commit hook. Final independent Codex autoreview was scoped-clean, with no P0/P1 findings (confidence 0.88). The final review supersedes the earlier review that identified the OpenRouter gap. Tests and runtime probes were performed separately from review.

Final owner/sibling proof: 411 tests passed across 23 files, complete changed gates passed, and pnpm build passed in 269.7 seconds (four dependency eval warnings, no ineffective dynamic-import warnings). Before the OpenRouter repair, owner regressions failed 19 cases in the shared normalizer and one case each in plugin discovery, embedded capabilities, and the publisher. Earlier phases captured 40 intended red regressions plus eight duplicate-owner cases and passed the 262-test integration, 515-test owner/sibling, 268-test duplicate-owner, and 80-test fixture runs; these overlap and are not presented as unique-test totals.

Exact final test and gate commands
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs packages/model-catalog-core/src/model-catalog-pricing.test.ts src/model-catalog/pricing.test.ts test/scripts/publish-model-catalog.test.ts src/model-catalog/remote-overlay.test.ts packages/model-catalog-core/src/remote-catalog-bundle.test.ts src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts
# 163 passed

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-usage-line.test.ts src/status/status-message.test.ts src/utils/usage-format.test.ts src/utils/usage-format.cost.test.ts src/utils/usage-format.agent-roster.test.ts src/agents/models-config.model-input-presence.test.ts src/agents/models-config.merge.test.ts src/config/io.runtime-snapshot-write.test.ts extensions/venice/models.test.ts extensions/venice/provider-runtime.contract.test.ts extensions/venice/onboard.test.ts extensions/opencode/index.test.ts extensions/opencode/onboard.test.ts extensions/opencode-go/index.test.ts extensions/openrouter/provider-catalog.test.ts extensions/openrouter/provider-runtime.contract.test.ts extensions/openrouter/onboard.test.ts
# 248 passed

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/check-changed.mjs --base e1f4101e1a2e3e4f4eaf745ef328bbb8092079fa -- docs/plugins/sdk-provider-plugins.md extensions/openrouter/provider-catalog.test.ts packages/model-catalog-core/src/model-catalog-pricing.test.ts packages/model-catalog-core/src/model-catalog-pricing.ts scripts/publish-model-catalog.mts src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts src/model-catalog/pricing.test.ts src/model-catalog/pricing.ts src/utils/usage-format.test.ts src/utils/usage-format.ts test/scripts/publish-model-catalog.test.ts
pnpm build
git diff --check

The parent reran all three real-function probes after the final build in fresh isolated HOME/state/temp directories, with OS-level network denial and no inference. The no-plugin probe resolves 0.003 and the exact footer Usage: 1.0k in / 1.0k out · est $0.0030; regression coverage also checks nonzero inherited cache prices, omitted/empty/zero/tiered input, and actual status text/presentation. The native-zero probe publishes and resolves both authoritative native providers to an estimate of exactly 0. The OpenRouter probe passes independent arithmetic for partial input, strict threshold, omitted cache prices, and later matching rows per key.

Public endpoint proof is real and unauthenticated: Node transport returned HTTP 200 for Venice (111 models) and OpenCode (94 models) at 2026-08-31 02:03:50 UTC, and OpenRouter at 03:03:35 UTC. The separate Python client received 403; reviewer-environment DNS failure was a limitation of that environment, not evidence that the Node API request failed.

OpenRouter captured-payload replay: 396 models, 67 overrides, 53 supported static boundaries across 48 models, including 33 overrides omitting cache prices. An independent oracle scans matching raw keys backwards and computes costs directly per token, rather than using compiled intervals. node --import tsx .artifacts/venice-dynamic-pricing/openrouter-capture-parity.mjs passed 15,904 scenarios / 79,520 cost comparisons, zero mismatches; 14 UTC overrides were excluded, and five negative-base rows explicitly asserted rejection. Capture SHA-256: 1876a950030d3ea9420f6ceb54a6a59ad2fe891b290be703091b209d1e77a30f. Contract: OpenRouter pricing object.

Venice real API plus local publisher artifact proof represented all 111 schedules / 14 extended schedules. Source-blind comparison passed 556 exact decimal rates / 756 boundary scenarios. Capture SHA-256: 6da350f42aaa171f9bf78d2722b791e7f282cda0934df54239a557a05b28c0aa. Separate synthetic publisher → real localhost HTTP → existing SQLite → fresh-process proof covers restart activation, process-stable snapshots, ETag/304, authored/local precedence and no lookup HTTP, with owned resources closed.

These are live public metadata requests, captured-artifact arithmetic, and synthetic lifecycle/display proofs. They are not a live operator Gateway/UI session, paid inference, or invoice reconciliation. Missing/malformed/explicit-zero API inputs and namespace isolation are tested through source-aware faults, not inferred from captures that lack such rows. Hosted catalog activation remains a separate owner action after merge; no catalog or release workflow is dispatched by this PR delivery.

Review findings and before-merge dispositions

The no-plugin finding, the native-zero finding in the ClawSweeper review, and the OpenRouter contract finding are repaired in the commit above. Original red evidence is retained in the finding comments.

ClawSweeper before-merge / quality request Disposition
Merge prepared prices beneath raw no-plugin costs; prove footer/status (P1 and repeated quality item) Repaired at the resolver owner; exact footer and status-boundary proof passed, with no plugin/network work.
Preserve authoritative native zero through publisher/resolver (P1 and repeated quality item) Repaired through shared source policy and exact hosted owner-key evidence; both native providers resolve zero, while unknown/untrusted zero cases remain unknown.
Fresh/existing-config compatibility and upgrade pricing proof Final 411-test run covers onboarding merge/replace, existing authored and agent-local prices, source snapshots, fresh runtime, disabled policy, aliases and private endpoints. No provenance migration is guessed.
Independently verify public pricing endpoints Real Node HTTP 200 observations and captured parity results above address the reviewer DNS gap; transport-specific 403/DNS limits are explicit.
Rerun focused tests and exact-head CI Focused tests, changed gates and local build passed. The old CSS/scaffold failures are repaired on main; this PR has been mechanically rebased for fresh exact-head hosted CI, recorded below.

The latest ClawSweeper review reviewed exact head 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000 at 2026-08-31 06:43 UTC and reports no actionable code findings, explicitly accepting the public parser artifact. Its remaining Before merge and Rank-up request is the compatibility decision: the maintainer explicitly accepts authoritative Venice/OpenCode feeds refreshing unpinned model estimates, existing serialized authored costs remaining authoritative, and merge-mode onboarding remaining non-migrating. This is the already-approved upgrade contract; no provenance migration is inferred. The required exact-head CI outcome is recorded below.

LOC against fork parent 119720344a871a667f973d5e4eb2ead8935466ed: runtime/library +600/-519 (net +81); publisher/tooling/manifest/config +334/-438 (net -104); combined non-test implementation net -23. Tests/support +1962/-70 (net +1892); docs +112/-32 (net +80). Source metadata moved from publisher to shared ownership is not additional feature growth. Runtime growth implements native schedule parsing/ownership and correct strict per-key compilation while duplicate registries/helpers/lookups are removed.

Public-artifact boundary disposition

The maintainer decision and compiled-entrypoint proof resolves the earlier ClawSweeper P2 and optional Rank-up move; the latest exact-head review accepts this boundary. extensions/venice/pricing-api.ts is the intentionally narrow top-level public artifact supported by extensions/AGENTS.md:71-74, discovered by public-surface build tooling and shipped as the external official plugin's package-local dist/pricing-api.js. Its actual package build and execution of byte-identical compiled files with the existing host SDK passed. It performs no network, auth, setup or plugin activation.

The shared registry is a closed upstream-feed contract. Manifest provider ownership, enablement and source mapping still govern generic runtime policy. The publisher is repository tooling; it does not add a Gateway request-time loader. The proposed extra manifest-dispatched hook or broad catalog-barrel re-export is intentionally skipped because the existing public artifact already provides the required boundary. No temporary private-import exception is accepted. Fresh/existing config and restart coverage above addresses the intended upgrade behavior.

Repaired-main CI recovery

The prior CI run 33355046925, attempt 1, failed six jobs on the same largest-CSS budget (54,809 B versus 54,784 B). Main commit 964fa991c0aff81e2ae46a0c9f99ebc0ab349d1a removes four unconsumed custom properties without changing the limit; the verified build is 54,732 B. Later main also consolidates footer selectors.

The provider scaffold failure, run 33355046937, attempt 1, is repaired by PR #133616, commit c093e85957b6ac9a3bda486a8de4fd43eafe57c8. Its scaffold CI 33357602625 passed. Parent verification on actual main 2013295097918f660a4a8839eb264ad9154b9284 passed 33 owner tests and pnpm test:plugins:init-provider-scaffold against installed public OpenClaw 2026.8.1, including compilation, generated catalog behavior and a clean Inspector. PR #129614 was closed unmerged as superseded; none of its separate candidate commits were imported here.

A single recovery rebase onto main b047b753b766e3dcbe259efc643a4eadb6d72c2d produced head da90f4505b634ebaa016eebc8ec880fa6490d1d2, with commits ee4b7a80b9fe75126b8dec225dfd115f7a6b49ba and da90f4505b634ebaa016eebc8ec880fa6490d1d2. Both individual stable patch IDs match their reviewed predecessors and git range-diff reports both unchanged. All 45 other touched files retain reviewed bytes; the remaining three test/harness files preserve upstream duplicate-test removal, mock cleanup and the compiled-subprocess plugin. No pricing source, UI patch, budget change or dependency repair was added. Recounted LOC is unchanged from above.

Recovery focused tests passed 342 tests across 12 files / seven shards in 387.26 seconds, using the command below. git diff --check, individual patch IDs, range-diff and the clean source tree were verified. Fresh hosted CI passed on the final byte-identical head; native preparation uses that exact-head evidence.

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs packages/model-catalog-core/src/model-catalog-pricing.test.ts src/model-catalog/pricing.test.ts test/scripts/publish-model-catalog.test.ts src/utils/usage-format.test.ts src/agents/models-config.model-input-presence.test.ts src/agents/models-config.merge.test.ts src/agents/embedded-agent-runner/model.forward-compat.errors-and-overrides.test.ts src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts extensions/venice/models.test.ts extensions/venice/onboard.test.ts extensions/opencode/index.test.ts extensions/openrouter/provider-catalog.test.ts

The native wrapper then required one additional guard refresh because main changed scripts/pr-lib/process-group-runner.mjs to keep Git maintenance within its owning operation. Refreshing onto 70338624f636fe006b61b9f39db4072f0364ac91 produced final head 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000 (source commits 40a62bc5555b795c3d282cdd629a86dab69debaf, 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000). All 48 tested files are byte-identical to the 342-test recovery head, and both individual pricing patch IDs remain unchanged. This was an enforced wrapper recovery, not a pricing repair; no additional source review was needed.

Fresh exact-head CI run 33364429994, attempt 1, passed on 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000. Provider scaffold run 33364430031, attempt 1, also passed on the same head. node scripts/watch-pr-ci.mjs 133695 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000 exited 0 with GREEN, zero pending checks. The intermediate run 33364286126 was superseded by that mandatory guard refresh. Native review artifacts validate as READY FOR /prepare-pr with issueValidation.status=valid. OPENCLAW_TESTBOX=1 scripts/pr prepare-run 133695 passed after green exact-head CI and verified the unchanged remote head. scripts/pr merge-run 133695 then passed and confirmed MERGED as 84da6ded4e27cf6dc67497a2143d685c33221d80 at 2026-08-31 06:50:26 UTC. All 48 touched file blobs match the tested head exactly in the merge commit. The land-ready proof and native completion receipt record the outcome. Live main rules enforce linear history and openclaw/ci-gate, non-strict, with no required-approval rule; no bypass is used.

@steipete steipete self-assigned this Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts agents Agent runtime and tooling extensions: venice extensions: opencode extensions: openrouter size: XL maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 01:25
@steipete

steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Pre-merge finding: preserve prepared prices in no-plugin usage lookup

Confirmed on head 165568262db31dfb6160bccc2a712abf1ca1495d: the new authored-source projection in src/utils/usage-format.ts:394–406 returns incomplete authored rates when allowPluginNormalization: false, before merging them with the already-prepared runtime schedule. normalizeModelCostConfig preserves missing fields; it does not complete them.

I reproduced this through the actual resolveModelCostConfig, estimateAggregateUsageCost, and resolveResponseUsageLine functions in a fresh temporary HOME/state directory, with network access prohibited and no provider inference:

sourceCost = { input: 1, output: 2 };
runtimeCost = { input: 1, output: 2, cacheRead: 0, cacheWrite: 0 };
setRuntimeConfigSnapshot(runtimeConfig, sourceConfig);
usage = { input: 1000, output: 1000, cacheRead: 0, cacheWrite: 0 };

With no agent-local models.json, the no-plugin resolver returns undefined cache rates. Expected estimate: 0.003. Actual estimate: undefined because zero tokens multiplied by undefined rates produce NaN. The actual footer is Usage: 1.0k in / 1.0k out, missing · est $0.0030. The equality assertion fails. The same resolver mode is used by src/status/status-message.ts:959–978; omitted or empty authored costs can also lose inherited flat prices when no recorded monetary fact is available.

Please repair the resolver owner before merging: in the no-plugin path, use the already-materialized config schedule as the lower-priority input, overlay projected authored rates with mergeModelCost, and normalize the merged result with normalizeResolvedPricing. Keep absence when neither source exists, agent-local precedence, and the no-plugin/no-network boundary. Merely zero-filling authored omissions before inheritance would lose known nonzero prepared rates.

Add paired source/runtime regression cases for partial, omitted, empty, and empty-tier costs, including nonzero inherited rates and the real footer/status boundary. This is a new rendering regression, separate from the intentionally documented historical repricing and serialized-price-pin limitations. The broader source ownership and complete-schedule refactor remains the right repair.

Resolution — published repair

Repaired in a419204e942. The no-plugin resolver now merges already-prepared prices beneath projected authored cost before final normalization, preserving no-source absence, agent-local precedence, explicit zero/flat/tier intent, and the no-plugin/no-network boundary. The original red reproduction above now returns 0.003 and exactly Usage: 1.0k in / 1.0k out · est $0.0030.

The final 411-test owner/sibling run includes nonzero inherited cache rates, omitted/empty/zero/tiered schedules and actual footer/status presentation. All three isolated network-denied probes were rerun after pnpm build; complete changed gates and final independent Codex autoreview passed with no P0/P1 findings. Exact-head CI is tracked in the PR Evidence section. No invoice or operator Gateway proof is claimed.

@steipete
steipete force-pushed the fix/native-pricing-authored-costs-20260830 branch from 1655682 to e1f4101 Compare August 31, 2026 01:26
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:43 AM ET / 06:43 UTC.

ClawSweeper review

What this changes

The PR adds native Venice and OpenCode pricing-source handling so catalog publication and runtime resolution preserve provider tier schedules.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The branch is not on current main and its source-level owner boundaries and focused coverage look coherent; leave it open for the maintainer-owned compatibility decision on catalog-fed pricing.

Priority: P2
Reviewed head: 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and well-covered at its owner boundaries; remaining review work is the deliberate pricing compatibility contract.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is reviewed from its source and supplied proof; its changes do not require external-contributor behavior evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is reviewed from its source and supplied proof; its changes do not require external-contributor behavior evidence.
Evidence reviewed 7 items Current-main check: The reviewed head is not an ancestor of the fetched main context, so current main does not contain this PR branch.
Provider parser and consumer: The Venice parser is a narrow provider-owned artifact; model discovery directly reuses it for fetched model pricing.
Publisher and shared tier semantics: Catalog publication uses the Venice parser, while shared price normalization derives strict thresholds and the usage calculator selects half-open ranges.
Findings None None.
Security None None.

How this fits together

Provider manifests feed OpenClaw’s model catalog, which runtime model resolution uses to calculate and report usage cost. The changed parsers and shared pricing policy prepare provider pricing before it reaches onboarding and configured model selection.

flowchart LR
  A[Provider price endpoint] --> B[Provider price parser]
  B --> C[Plugin pricing policy]
  C --> D[Catalog publisher]
  D --> E[Runtime model resolution]
  E --> F[Usage cost reporting]
Loading

Decision needed

Question Recommendation
Should OpenClaw adopt authoritative Venice and OpenCode price feeds while retaining existing serialized model costs as overrides and leaving merge-mode re-onboarding non-migrating? Adopt the compatibility contract: Merge with provider feeds enabled while existing authored cost schedules continue to override generated catalog values.

Why: Whether refreshed provider prices should coexist with pre-existing operator pricing is an intentional upgrade contract, not a source-proven implementation defect.

Before merge

  • Resolve merge risk (P1) - Catalog-fed schedules can change default estimates for unpinned models; existing serialized costs deliberately remain authoritative, so maintainers must accept that upgrade behavior.
  • Complete next step (P2) - Maintainers need to accept the intentional upgrade behavior for generated price schedules versus existing serialized cost values.
Agent review details

Security

None.

PR surface

Source +88, Tests +1891, Docs +80, Config +8, Other -118. Total +1949 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 23 620 532 +88
Tests 16 1960 69 +1891
Docs 6 112 32 +80
Config 2 8 0 +8
Generated 0 0 0 0
Other 1 308 426 -118
Total 48 3008 1059 +1949

Review metrics

Metric Value Why it matters
Production and test delta production +936/-958 (net -22); docs/tests +557/-48 The production refactor is net-negative, but the cross-surface provider catalog and configuration behavior deserves compatibility review.
Authoritative source mappings 2 added Venice and OpenCode become provider-owned catalog-price sources, expanding the refresh contract.

Merge-risk options

Maintainer options:

  1. Confirm the upgrade contract (recommended)
    Merge after maintainers explicitly accept that authored costs override catalog prices and merge-mode onboarding does not rewrite them.
  2. Pause for migration design
    Pause if provider-fed schedules are expected to replace existing serialized costs rather than serve as lower-priority defaults.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Confirm the explicit-cost override and merge-mode onboarding compatibility contract, then require exact-head CI.

Technical review

Best possible solution:

Land only with the explicit-cost override and non-migrating merge-mode onboarding behavior deliberately accepted as the catalog compatibility contract.

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

Yes, at source level: focused tests specify the parser, tier boundary, catalog and onboarding paths, although this read-only review did not execute them.

Is this the best way to solve the issue?

Yes, conditionally: provider-owned parsers plus the shared pricing policy are the correct ownership split, once maintainers accept the explicit-cost compatibility behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 01eb7d52384a.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is reviewed from its source and supplied proof; its changes do not require external-contributor behavior evidence.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded provider-catalog improvement with a compatibility-sensitive default effect, not an emergency.
  • merge-risk: 🚨 compatibility: The new feeds can change estimates for models without serialized costs while existing explicit costs intentionally remain authoritative.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is reviewed from its source and supplied proof; its changes do not require external-contributor behavior evidence.

Evidence

Acceptance criteria:

  • [P1] Verify exact-head CI after confirming the explicit-cost override and merge-mode onboarding contract.

What I checked:

  • Current-main check: The reviewed head is not an ancestor of the fetched main context, so current main does not contain this PR branch. (2a1ea4b7ad8d)
  • Provider parser and consumer: The Venice parser is a narrow provider-owned artifact; model discovery directly reuses it for fetched model pricing. (extensions/venice/models.ts:110, 2a1ea4b7ad8d)
  • Publisher and shared tier semantics: Catalog publication uses the Venice parser, while shared price normalization derives strict thresholds and the usage calculator selects half-open ranges. (scripts/publish-model-catalog.mts:411, 2a1ea4b7ad8d)
  • Configuration and onboarding contract: Merge-mode Venice onboarding avoids serializing generated pricing, and configured-model merging preserves source cost precedence over derived defaults. (extensions/venice/onboard.ts:11, 2a1ea4b7ad8d)
  • Focused coverage: Tests cover complete live provider prices, native catalog schedules and free-price handling, and malformed or unavailable source behavior. (test/scripts/publish-model-catalog.test.ts:403, 2a1ea4b7ad8d)
  • Public plugin artifact boundary: The extension guidance and runtime build helper support buildable top-level public plugin artifacts, resolving the earlier boundary concern about the Venice parser. (scripts/lib/plugin-npm-runtime-build.mts:342, 2a1ea4b7ad8d)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the explicit-cost and onboarding contract, then verify exact-head CI before merge.

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 (2 earlier review cycles)
  • reviewed 2026-08-31T01:37:31.429Z sha e1f4101 :: needs changes before merge. :: [P1] Merge prepared prices before returning the raw no-plugin cost | [P1] Retain authoritative zero schedules in runtime pricing resolution
  • reviewed 2026-08-31T04:04:48.288Z sha a419204 :: found issues before merge. :: [P2] Keep Venice pricing parsing behind the plugin public API

@steipete

steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Additional pre-merge finding: OpenRouter override semantics

Fresh review found an OpenRouter contract mismatch in the shared parser. I verified the official pricing contract and independently reproduced four failures against the current candidate:

  • A prompt-only context override is rejected instead of inheriting the other base prices.
  • An override activates at the threshold, although OpenRouter defines the condition as total prompt tokens strictly greater than it.
  • Omitted cache prices become zero rather than inheriting their price.
  • Sorting overrides as independent schedules loses the documented later-entry, per-key precedence when several conditions match.

A fresh unauthenticated models request returned 396 models and 67 overrides, including 53 static prompt overrides; 33 prompt overrides omit at least one cache-price field. This is not an invoice or paid-inference test. The metadata capture SHA-256 is 1876a950030d3ea9420f6ceb54a6a59ad2fe891b290be703091b209d1e77a30f.

The repair belongs in normalizeOpenRouterModelPricing: compile the supported static conditions into complete schedules using the same provider's base prices and source-order precedence, with strict integer token boundaries. This is within-source inheritance, not cross-provider/feed price mixing. Time/unknown conditions must remain excluded; explicit malformed rates must not be silently repaired with unrelated prices.

Landing remains held while this owner repair and boundary regression proof are completed. The two earlier no-plugin/native-zero findings have local passing repairs, and will be published together after the next clean review.

Resolution — published repair

Repaired in a419204e942. The shared OpenRouter compiler now inherits omitted same-source fields, activates at unique floor(N)+1 boundaries, and applies matching rows in original source order per price key. Equal thresholds and explicit zero work; UTC and unknown predicates stay excluded. Generic calculator and upstream/OpenCode/Venice boundary semantics are unchanged, and SDK documentation is corrected.

Before the repair, 19 normalizer cases and one case each in plugin discovery, embedded capabilities and publication failed. Final owner/sibling proof passed 411 tests across 23 files, complete changed gates and pnpm build. Captured replay passed 15,904 scenarios / 79,520 comparisons with an independent raw-key/per-token oracle and zero mismatches; 14 UTC overrides were excluded and five negative-base rows explicitly asserted rejection. All four original independent numeric probes pass. Final Codex autoreview is scoped-clean with no P0/P1 findings. These are public metadata and synthetic arithmetic proofs, not invoice or paid-inference parity.

steipete added a commit that referenced this pull request Aug 31, 2026
Merge prepared costs beneath authored display prices, retain validated native
free schedules under exact owner policy, and compile OpenRouter overrides
with strict thresholds and source-order inheritance for each price key.

Preserve zero, partial, flat and tiered user pricing without new settings
or storage. Follow-up repairs for #133695.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Published repair head: a419204e942b6fffbddd9272214ae8da630f9a2f. Both prior P1 resolver findings are repaired, with footer/status and publisher-to-resolver proof. The additional OpenRouter repair implements the documented strict thresholds and source-order inheritance per price key. PR Evidence now records final 411-test coverage, changed gates/build, fresh/existing-config cases, real public metadata requests, independent capture parity, and the exact-head CI run. The final independent Codex review is scoped-clean; synthetic and live-proof limits remain explicit.

@clawsweeper

clawsweeper Bot commented Aug 31, 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:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Native-pricing boundary decision

The remaining P2's private-helper premise does not apply to this entrypoint. The selected boundary is the existing narrow public artifact contract, not a temporary import of plugin internals:

  • The scoped plugin guide explicitly permits top-level *-api.ts public artifacts. pricing-api.ts is intentionally that public, pure pricing projection; it performs no network, auth, setup, or plugin activation.
  • Public-surface build discovery and the package runtime build plan register it as the package's dist/pricing-api.js entry. Venice is an external official plugin (bundledDist: false), so its package-local artifact—not core dist/extensions—is the relevant output.
  • The actual package-local build passed with node scripts/lib/plugin-npm-runtime-build.mjs extensions/venice. Its byte-identical compiled artifact also executed successfully in plain Node with the existing repository host SDK available. This is compiled-entrypoint proof, not a claim that an uninstalled source package has a managed host-peer link.

The shared registry describes a closed set of upstream pricing feeds and their source-authority contract. It does not select runtime provider defaults or own Venice payload interpretation. The plugin manifest still owns source opt-in/mapping; manifest normalization enforces provider ownership; runtime policy remains provider-agnostic; Venice decoding stays in its public plugin artifact. The publisher is repository tooling, not a Gateway request-time loader.

Rank-up disposition: keep this existing public-artifact boundary and the shared closed feed registry. A new manifest-dispatched publisher hook is not needed for the current sources and would add another plugin API/activation path. Routing this pure decoder through the broad catalog barrel would likewise add unnecessary dependencies. No private-import compatibility exception is being accepted.

Upgrade behavior remains covered by fresh/existing-config, prepared-source, explicit-zero/partial/tier, and restart tests. The remaining landing blockers are the recorded CI failures; the existing provider-scaffold repair is now explicitly approved as a dependency, with a source-level CSS budget cleanup being prepared without raising limits.

Use complete native OpenCode and Venice pricing schedules while preserving
authored zero, partial, flat and tiered costs across preparation and lookup.
Avoid generated price pins during fresh merge-mode Venice onboarding.

Follow-up to #133349 (cached long-context accounting) and #129694
(Venice runtime pricing); related to #113549 (broader OpenCode catalog drift).
Merge prepared costs beneath authored display prices, retain validated native
free schedules under exact owner policy, and compile OpenRouter overrides
with strict thresholds and source-order inheritance for each price key.

Preserve zero, partial, flat and tiered user pricing without new settings
or storage. Follow-up repairs for #133695.
@steipete
steipete force-pushed the fix/native-pricing-authored-costs-20260830 branch from da90f45 to 2a1ea4b Compare August 31, 2026 06:29
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000.

The native source/preparation owner now preserves authored cost intent through resolution and usage display. Venice parsing stays in the supported public pricing-api.ts artifact; the shared registry describes closed upstream feeds, with manifest ownership and enablement controlling runtime policy. OpenRouter native overrides inherit omitted keys, activate strictly above their threshold, and apply source-order precedence per key. Duplicate registries/helpers/lookups were removed; there is no new operator option, store, schema, dependency or request-time pricing HTTP.

The maintainer explicitly accepts the compatibility contract requested by the latest exact-head ClawSweeper review: refreshed native feeds serve unpinned models, existing serialized authored costs remain authoritative, and merge-mode onboarding does not migrate existing pins. That review has no actionable code findings and accepts the public artifact. The earlier optional hook/barrel rewrite is superseded by the documented owner decision and compiled-entrypoint proof. All Before merge and Rank-up items are addressed.

Exact-head hosted proof, both attempt 1:

  • CI 33364429994: success, pull_request head 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000; required openclaw/ci-gate green.
  • Provider scaffold 33364430031: success, same head.
  • node scripts/watch-pr-ci.mjs 133695 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000 exited 0, GREEN, pending 0.

The repaired-main rebase and mandatory native-wrapper refresh preserve both reviewed pricing patch IDs. Final source commits are 40a62bc5555b795c3d282cdd629a86dab69debaf and 2a1ea4b7ad8d78884f7714bab2a4845cd11d9000; all 48 final touched files are byte-identical to the recovery-tested head. The following recovery command passed 342 tests / 12 files / 7 shards:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs packages/model-catalog-core/src/model-catalog-pricing.test.ts src/model-catalog/pricing.test.ts test/scripts/publish-model-catalog.test.ts src/utils/usage-format.test.ts src/agents/models-config.model-input-presence.test.ts src/agents/models-config.merge.test.ts src/agents/embedded-agent-runner/model.forward-compat.errors-and-overrides.test.ts src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts extensions/venice/models.test.ts extensions/venice/onboard.test.ts extensions/opencode/index.test.ts extensions/openrouter/provider-catalog.test.ts

Prior final contract proof remains valid: 411 tests across 23 files, complete changed gates, pnpm build, three independent parent probes, and the source-independent OpenRouter capture oracle (15,904 scenarios / 79,520 comparisons, zero mismatches). The no-plugin real presentation footer is Usage: 1.0k in / 1.0k out · est $0.0030. Native-zero tests cover trusted free schedules and rejection of unknown/unowned/disabled/private/alias cases.

Real unauthenticated Node metadata requests returned HTTP 200 for Venice/OpenCode (111/94 models) and OpenRouter (396 models). Venice captured arithmetic covered 556 decimal rates / 756 boundary cases; OpenRouter replay covered 53 static boundaries, excluded 14 UTC overrides and rejected five negative-base rows. Separate Python 403 and reviewer DNS failures are transport/environment observations. Publisher → real localhost HTTP → existing SQLite → fresh-process lifecycle proof is synthetic; there was no paid inference, live operator Gateway session or invoice reconciliation. Existing serialized pins, historical unbilled repricing, UTC scheduling and capability-cache lifecycle are not redesigned.

Native scripts/pr review-init, baseline/head checkout, artifact initialization and validation passed (READY FOR /prepare-pr, issueValidation.status=valid). OPENCLAW_TESTBOX=1 scripts/pr prepare-run 133695 exited 0, accepted hosted gates, skipped an unnecessary push, and verified the exact remote head. Live main rules require linear history and openclaw/ci-gate (non-strict), with no required independent-approval rule. No bypass is used. Merge follows only through scripts/pr merge-run 133695.

The old CSS/scaffold failures were recovered through existing main fixes, with no pricing-branch UI edit or budget increase. PR #129614 is closed unmerged as superseded by landed #133616; its candidate was not imported. Broader OpenCode tracker #113549 remains open.

Final LOC: runtime/library +600/-519 (net +81); publisher/tooling/manifest/config +334/-438 (net -104); combined non-test -23; tests/support +1962/-70 (net +1892); docs +112/-32 (net +80). Runtime additions implement native parsing, authored ownership and strict per-key compilation; moved metadata is counted once. Hosted catalog activation remains with the parent; no catalog or release workflow was dispatched.

@steipete
steipete merged commit 84da6de into main Aug 31, 2026
263 checks passed
@steipete
steipete deleted the fix/native-pricing-authored-costs-20260830 branch August 31, 2026 06:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Post-merge hosted catalog verification

Catalog activation is complete. Publish catalog run 33366265306 succeeded and produced catalog commit bcf5bafe6fa99ae287ef8ad61b3ccaf85a26654c. Its recorded OpenClaw source is 22ae6417e9fe9293cbbfb2a36248e647b802d48e, verified to contain this PR's merge 84da6ded4e27cf6dc67497a2143d685c33221d80 and to match the source main captured immediately before dispatch.

At 2026-08-31 07:07 UTC, the ordinary canonical catalog URL, without cache-busting, served byte-identical content to the committed artifact. An independent metadata comparison against fresh unauthenticated native feeds passed:

  • Venice: all 111 text-model schedules, including 14 extended-context schedules; 0 unavailable/invalid API schedules.
  • OpenCode: all 94 model schedules, including 11 tiered schedules and exact hosted evidence for 30 authoritative all-zero schedules; 0 unavailable/invalid API schedules.
  • 1,024 rate comparisons, plus tier-count/range assertions, passed. Catalog SHA-256: 263a80fb9e415f8fa59e593012fa166b07178e63295efa62cffcd560059663f8.

This is published metadata parity, not invoice or paid-inference proof. OpenCode retains its existing metadata threshold contract. No inference requests, npm/software release, version bump, or operator Gateway restart occurred. Existing explicit price pins remain authoritative; the documented four-hour publisher, six-hour client refresh, and restart-owned prepared-snapshot lifecycle are unchanged. See Venice provider documentation.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…w#133695)

* fix(models): refresh native pricing without pinning defaults

Use complete native OpenCode and Venice pricing schedules while preserving
authored zero, partial, flat and tiered costs across preparation and lookup.
Avoid generated price pins during fresh merge-mode Venice onboarding.

Follow-up to openclaw#133349 (cached long-context accounting) and openclaw#129694
(Venice runtime pricing); related to openclaw#113549 (broader OpenCode catalog drift).

* fix(pricing): preserve native schedules through resolution

Merge prepared costs beneath authored display prices, retain validated native
free schedules under exact owner policy, and compile OpenRouter overrides
with strict thresholds and source-order inheritance for each price key.

Preserve zero, partial, flat and tiered user pricing without new settings
or storage. Follow-up repairs for openclaw#133695.
obviyus added a commit that referenced this pull request Sep 19, 2026
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.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…w#111175)

Related: openclaw#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 openclaw#114060 and openclaw#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 `b16cb8c0` 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.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 extensions: opencode extensions: openrouter extensions: venice maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

1 participant