Skip to content

refactor(models): preserve catalog metadata through one normalization path - #130381

Merged
steipete merged 1 commit into
mainfrom
codex/model-catalog-normalization-cleanup
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/model-catalog-normalization-cleanup

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Model catalogs normalized and projected the same fields independently in several places. These copies drifted: scoped model listing dropped selectable context windows and thinking maps, while agent manifest catalogs dropped image-input policy. Cached rows could also inherit capabilities from a different API endpoint with the same provider/model id.

Why This Change Was Made

Reuse the existing model-field normalizer, derive normalized-row fields from the model contract, and share one dependency-light, allowlisted catalog-entry projection. Keep provider ordering at its existing owner. Use the existing transport matcher before enriching persisted rows, so capabilities stay bound to their physical route.

Discovery, auth, model defaults, persistence formats, and public SDK exports are unchanged. The shared projection does not expose transport headers or authoring metadata.

Production LOC: +55/-126 (net -71). Tests: +71/-3 (net +68). Docs: +2.

User Impact

Agent and CLI catalog paths preserve provider-declared model metadata consistently. Custom endpoints no longer borrow a different route's context limits or reasoning capabilities. This also reduces the number of places future model metadata additions must update.

Evidence

  • Reproduced the metadata omissions and cross-endpoint inheritance with failing regressions before changing production code.
  • 189 distinct tests across 13 files passed, covering normalization, provider defaults, remote overlays, provider SDK consumers, route matching, prepared catalogs, scoped/persisted listing, model-list rows, forward-compatible listing, browsing, and visibility. The final test-fixture cleanup passed another 14-test rerun.
  • Rebuilt the actual CLI and exercised both configured and --all Z.AI model views in isolated state. Both listed zai/glm-5.3-flash with text+image input, context 1048576, and missing=false. Temporary state was removed; no live Gateway or credential changes.
  • Core production and full core-test typechecking passed. Formatting, changed-source lint, dead-export, import-cycle, native schema, database-first, sidecar, media, webhook, and auth guards passed across the changed gate and targeted reruns. A missing linked UI dependency directory initially resolved root pako 1.x instead of the existing UI pako 3.x install; linking that existing directory fixed the environment. One unnecessary test-fixture spread was removed after lint caught it.
  • Codex P0 autoreview passed with no actionable P0 findings. Exact-head hosted CI is the final landing gate.

Related follow-ups intentionally remain separate: consolidate MiniMax's duplicated model builders; prepare model-policy alias indexes once while preserving distinct policy and selection scopes.

@clawsweeper

clawsweeper Bot commented Aug 26, 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 commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete steipete self-assigned this Aug 26, 2026
@steipete
steipete merged commit cf457d0 into main Aug 26, 2026
207 checks passed
@steipete
steipete deleted the codex/model-catalog-normalization-cleanup branch August 26, 2026 20:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant