Repository navigation
fix(models): preserve exact authored pricing - #144182
Conversation
Recover source prices through the shared row materializer so aliases and literal self-prefixed rows cannot donate prices to an exact configured row. Forward captured normalization policies through runtime overrides and configured fallback, preserving same-spelling, zero, partial, and tiered pricing behavior. Remove the obsolete scoped matcher. Keep the public resolver pricing matrix and separate its test fixtures without weakening assertions. Known limitation: retained configurations still use the current global config/source projection. Baseline and candidate have identical A/B authorship-switching behavior; this change does not add retained-source isolation. Related: #130706, #142100
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 12:36 PM ET / 16:36 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR preserves each configured model’s authored pricing by sharing exact-row selection, carrying captured alias policies through both pricing paths, and expanding regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still combines prices across matching aliases. No blocking defect was found, and the updated compiled-validation evidence resolves the previous review’s outstanding request. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw combines configured model metadata with discovered catalog prices before running an agent. This change controls which authored price fields override the catalog schedule during normal resolution and configured fallback. flowchart TD
A[Authored model rows] --> C[Shared row selection]
B[Captured alias policies] --> C
C --> D[Selected model pricing]
E[Catalog price schedule] --> F[Merge authored prices]
D --> F
F --> G[Resolved or fallback model]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -33, Tests +233. Total +200 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the shared authored-row selector consistently for pricing, preserving explicit rates and catalog inheritance while keeping retained-source isolation as separate work. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the trigger: configure an alias with prices beside an exact destination with omitted prices, then resolve that destination against a source snapshot. Current main merges both rows; no execution was performed during this review. Is this the best way to solve the issue? Yes. Reusing the existing materializer aligns pricing with the documented row-selection contract and removes competing matching logic without changing storage, configuration, or plugin APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 66f95eddbf95. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
The outstanding compiled-validation item is complete at The eight additional A/B controls reproduce the explicitly documented inherited source-projection limitation; they are not a claim that retained-source isolation was repaired. Exact-head CI is still required before landing. |
|
Merged via squash.
|
Recover source prices through the shared row materializer so aliases and literal self-prefixed rows cannot donate prices to an exact configured row. Forward captured normalization policies through runtime overrides and configured fallback, preserving same-spelling, zero, partial, and tiered pricing behavior. Remove the obsolete scoped matcher. Keep the public resolver pricing matrix and separate its test fixtures without weakening assertions. Known limitation: retained configurations still use the current global config/source projection. Baseline and candidate have identical A/B authorship-switching behavior; this change does not add retained-source isolation. Related: openclaw#130706, openclaw#142100
Related: #130706, #142100. Builds on #144034.
What Problem This Solves
Runtime pricing could merge prices from an alias or a similarly spelled row into an exact configured model. It also normalized selected model IDs again while recovering authored prices, so alias chains could select a different row.
Why This Change Was Made
Use the existing configured-row materializer to recover authored costs, preserving exact-row precedence and resolving source aliases once. Pass the captured normalization policies through both runtime overrides and configured fallback. Remove the obsolete scoped matcher.
This removes 33 production lines across three files. Same-spelling partial costs, explicit zero, and tiered pricing retain their existing merge rules. No storage or configuration surface changes.
User Impact
An exact configured model keeps its own authored price fields. Omitted fields retain the catalog schedule instead of receiving another row's prices or materialized defaults.
Evidence
0c54207e6d045042e7973fc8e3eb6f58e68165d8passed, including declarations. Through emittedresolveModelAsyncand real registries, all 32 pricing cases passed, with 64 observations of the intended caller paths. V8 coverage confirmed execution of both override and configured-fallback owners.A known limitation remains: retained configurations still consult the current global runtime/source pair. A separate baseline/candidate comparison reproduced identical behavior in both directions of an authorship switch, including distinct byte-identical runtimes, same-object rebinds, and retained originals/clones through both cost callers. This cut fixes row selection within the supplied source; it does not establish retained-source isolation.