Repository navigation
fix(anthropic): don't crash models list when a configured Sonnet 5 model has no cost - #102186
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 5:06 PM ET / 21:06 UTC. Summary PR surface: Source +4, Tests +67, Generated 0, Other 0. Total +71 across 11 files. Reproducibility: yes. by source inspection. Current main builds configured provider list rows without cost and passes them into provider normalization, where the Sonnet 5 normalizers dereference model.cost fields directly; I did not run a live repro in this read-only review. Review metrics: 2 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land this provider-owned normalization fix after exact-head CI if maintainers accept the additive SDK helper; otherwise keep the comparator private or provider-local and refresh the SDK artifacts. Do we have a high-confidence way to reproduce the issue? Yes by source inspection. Current main builds configured provider list rows without cost and passes them into provider normalization, where the Sonnet 5 normalizers dereference model.cost fields directly; I did not run a live repro in this read-only review. Is this the best way to solve the issue? Yes, conditional on maintainer acceptance of the additive SDK helper. The fix stays at the provider-owned normalization boundary and covers all three sibling normalizers instead of padding display rows or catching failures later. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 129e2795ae11. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +67, Generated 0, Other 0. Total +71 across 11 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (5 earlier review cycles)
|
bff34ee to
82622fd
Compare
82622fd to
63610e0
Compare
…del has no cost applyAnthropicSonnet5Cost read params.model.cost.input unconditionally, so 'openclaw models list' aborted with 'Cannot read properties of undefined (reading input)' whenever config supplied an anthropic Sonnet 5 model row without cost metadata (e.g. an agents.defaults.models runtime binding). Guard with optional chaining — a costless model now falls through and gets the canonical Sonnet 5 cost applied. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-authored-by: VACInc <[email protected]>
a60f748 to
8f07db9
Compare
|
Maintainer closeout for exact head
Known proof gaps: none for this credential-free CLI path. |
|
Merged via squash.
|
…del has no cost (openclaw#102186) * fix(anthropic): don't crash models list when a configured Sonnet 5 model has no cost applyAnthropicSonnet5Cost read params.model.cost.input unconditionally, so 'openclaw models list' aborted with 'Cannot read properties of undefined (reading input)' whenever config supplied an anthropic Sonnet 5 model row without cost metadata (e.g. an agents.defaults.models runtime binding). Guard with optional chaining — a costless model now falls through and gets the canonical Sonnet 5 cost applied. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(models): normalize missing Sonnet 5 costs Co-authored-by: VACInc <[email protected]> * chore(plugin-sdk): refresh API baseline * ci(plugin-sdk): update surface budgets --------- Co-authored-by: VACInc <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…s/deploy.sh; close catalog-warning item, root-cause models-list crash - spec TL;DR: both rsyncs, post-deploy dist-runtime import assertion, layout row for dist-runtime, pointer to the scripted deploy. - .matt/scripts/deploy.sh: detached build, backup both trees, rsync both, assertion + marker grep, RESTART_REASON.md, deferred restart, rollback line. Dry-run self-test passed on the live trees. - status: model-catalog warning closed (gone at 20:48/21:02 boots, mechanism of disappearance noted as unpinned); models list crash traced to applyAnthropicSonnet5Cost lacking upstream's modelCostsEqual guard (upstream 740e768 / openclaw#102186, not in v2026.7.1-2). Co-Authored-By: Claude Fable 5 <[email protected]>
What Problem This Solves
openclaw models listcould crash when a configured Claude Sonnet 5 row reached provider normalization without cost metadata. Configured-list and discovery rows are intentionally partial projections, socostis not guaranteed at those call sites.Why This Change Was Made
Sonnet 5 pricing normalization now uses one missing-cost-safe flat-cost comparator shared by Anthropic, Amazon Bedrock Mantle, and Anthropic Vertex. This fixes all three reachable sibling normalizers at their provider-owned boundary instead of padding display rows with invented runtime fields or catching and hiding normalization failures.
User Impact
Configured Sonnet 5 models list normally, retaining image capability and context metadata, without requiring provider credentials or cost fields in configuration.
Evidence
openclaw models listrenderedanthropic/claude-sonnet-5astext+imagewith1000kcontext and exited 0 in a credential-free isolated environment.--plainruns in two fresh homes.pnpm check:changed, formatting, Plugin SDK API generation/check, and fresh Codex autoreview passed.Contributor implementation and regression context by @VACInc; maintainer follow-up broadens the fix across the full sibling surface.