Repository navigation
fix(models): resolve authored catalog aliases once - #143967
Conversation
Materialize authored provider rows before discovery and preserve exact destination fields, including omissions. Keep source input and pricing facts tied to exact provider/model tuples through both merge passes. Finalize manual and generated catalogs without reinterpreting their identities, while retaining existing Google and Together model retirements. Preserve current session-registry metadata and transport ownership. 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, 7:08 AM ET / 11:08 UTC. ClawSweeper reviewWhat this changesThe PR resolves configured model aliases before discovery, preserves literal catalog IDs during refresh, and keeps authored pricing and input capabilities attached to the correct model. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and the latest release retain the problematic normalization path. No blocking correctness finding was identified, and the broader related PR is a decomposition reference rather than a replacement. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's model catalog planner combines configured models, plugin discovery, and existing catalogs. Its output feeds the session model registry, which supplies model identities and capabilities for agent execution. flowchart TD
A[Configured model rows] --> B[Resolve aliases once]
B --> C[Merge exact model metadata]
D[Plugin discovery] --> C
C --> E[Finalize catalog rows]
F[Existing catalogs] --> E
E --> G[Session model registry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +28, Tests +307, Docs +6. Total +341 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep alias interpretation at the authored-input boundary and preserve emitted identities and exact field ownership through subsequent catalog refreshes. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a concrete path: configure a chained alias and refresh the catalog through repeated normalization. The added regression cases target that path; this review did not execute them. Is this the best way to solve the issue? Yes. Resolving authored rows before discovery and retaining literal identities afterward fixes the producer boundary while reusing existing pricing, merge, and retirement helpers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 341932a8ef40. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Materialize authored provider rows before discovery and preserve exact destination fields, including omissions. Keep source input and pricing facts tied to exact provider/model tuples through both merge passes. Finalize manual and generated catalogs without reinterpreting their identities, while retaining existing Google and Together model retirements. Preserve current session-registry metadata and transport ownership. Related: openclaw#130706, openclaw#142100
Related: #130706, #142100. Follows the planner cleanup #143851.
What Problem This Solves
Provider catalog planning can apply an authored alias more than once:
entry → middle → finalcan publish the wrong model and miss the intended discovery donor. Later publication can also reinterpret already-emitted manual/plugin IDs. Source cost and input-presence records use display keys that can attach one row's fields to another model.Why This Change Was Made
Resolve authored rows once before discovery. Merge same-spelling partial costs, select an exact destination before equivalent rows, and retain omitted fields for the real catalog donor. Carry source cost/input-presence facts with exact provider/model tuple keys. Later catalog publication preserves emitted IDs and applies only the existing Google/Together retirement corrections.
Provider/auth normalization, secret-marker enforcement, root authorship, replace-mode membership, and the generic registry merge contracts remain in their existing owners. Remove their obsolete alias-normalization plumbing and document the catalog behavior. This adds 28 production lines; the separately landed planner cleanup #143851 removed 47.
User Impact
Configured aliases select the intended executable model, explicit input/cost metadata stays attached to its row, and repeated refreshes preserve manual and generated catalog IDs. No setting, dependency, schema, or stored-state design is added.
Evidence
Six intended regressions failed against unchanged main, covering duplicate input ownership, repeated alias resolution in merge/replace modes, and manual catalog drift in both row orders. The fixed focused cohort passed 206 tests across 11 files, including normalization, merging, source metadata, root authorship, discovery, environment handling, retirement corrections, and ModelRegistry. Two mechanical test-fixture type/lint corrections subsequently passed 51 focused tests and targeted lint. Fresh P2 review and the complete changed-file gate passed; production remained unchanged through those fixture corrections.
At exact commit
c481d1644dbf8b2d86cd52c8ebed2f4b349681e9, one canonicalsourcePerformancebuild and all 12 compiled public writer/registry scenarios passed. They repeat merge/replace planning and verify exact omissions, duplicate input, namespace-separated costs, and literal manual/generated IDs, including spaced IDs. All 9,253 captured root/workspace build files were unchanged, no checkout TypeScript or HTTP was used, both synthetic state roots were removed, and all processes joined. This runtime build excludes UI and SDK declarations.The first compiled attempt stopped with an incomplete hand-built metadata fixture. The retained failure was corrected by constructing metadata through the emitted canonical producer; no product changes, rebuild, or restamping occurred. Review also caught an unnecessary trim of emitted IDs, which was reproduced and removed before the final source review.