Repository navigation
refactor(models): prepare model-list context once - #130600
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 10:32 PM ET / August 27, 2026, 02:32 UTC. ClawSweeper reviewWhat this changesThe PR prepares provider-alias context once for Merge readinessKeep open for normal maintainer review: no blocking defect surfaced, but this maintainer-owned, Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits together
flowchart LR
A[CLI model-list options] --> B[Configuration and target agent]
B --> C[Manifest metadata snapshot]
C --> D[Prepared provider alias context]
D --> E[Registry and catalog rows]
E --> F[Configured and discovered row projection]
F --> G[Table or JSON output]
Decision needed
Why: The PR is authored by a repository member and carries the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -196, Tests +19, Other -1. Total -178 across 15 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one command-owned alias canonicalizer and the consolidated registry adapter, then merge only after exact-head validation and the current review guidance are satisfied. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor rather than a report of broken behavior, and the changed command paths are covered by focused command tests. Is this the best way to solve the issue? Yes: preparing immutable alias context at the command boundary and passing it to row builders removes repeated setup without creating a parallel behavior path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c35b18309329. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(models): prepare model-list context once * test(models): consolidate model-list row contexts
What Problem This Solves
models listrebuilt manifest provider-alias maps during row construction, routed full registry loading through a forwarding module, and wrapped every availability failure in a private error code only to catch that same code and choose one fallback. The command already owns the metadata snapshot and the shared configured-model projection already accepts its canonicalizer.Why This Change Was Made
Prepare the alias canonicalizer once in the command and carry it into configured refs and row builders. Consolidate full and targeted registry access under
list.registry.ts; remove the forwarding module, unused CLI availability options, redundant lazy-loader functions, and the private error-code stack. Share row input projection and make synchronous row assembly synchronous.Production: +110/-306 (net -196). Tests: +138/-119 (net +19). Assertion baseline: +1/-2, shrinking the allowance for two deleted casts. No config keys/defaults, public flags, plugin SDK contracts, provider policy, credentials, network discovery, or persistence changes.
User Impact
No intended output change. Default listing remains lazy;
--localkeeps targeted configured lookups, while full/provider-filtered lists use the prepared registry. Discovery and configured lookup errors remain fatal. Failed/malformed availability yields one visible warning and auth heuristics; an empty availability result remains authoritative. Display aliases never replace the source provider used for auth. Provider/model ordering, suppression modes and metadata stay unchanged.Evidence
6b019aa1f7462bccf6ea775150f6ad84bffee226: production and core-test typechecks, full core type-aware lint, formatting, unused-export scans, assertion ratchets, import cycles and architecture guards. Earlier checks exposed a stale assertion allowance, an unused import and a test-file line-limit violation; all were fixed and the full gate rerun successfully.--all(224),--local(1), and--provider fixture-local(1). The all-model view retains GLM 5.3 Flash's text+image and 1,048,576 context metadata. The earlier full 15-phase build passed on the parent catalog batch. No authenticated inference is claimed for this internal command refactor.--all --provider Z.AI --jsonreturns six canonicalzai/*rows, includingzai/glm-5.3-flashwithtext+image, a 1,048,576 context window andmissing: false. Availability is intentionally unknown without credentials.6b019aa1f7462bccf6ea775150f6ad84bffee226, including all 65 selected plugin shards. The superseded first-head CI was replaced after the local type/lint fixes described above.9a86f34e07db385ffd4366e8c15cf1340b8ad3fd. The final PR build's four actual CLI views still match baseline; the relevant model-list/provider source files are unchanged between that build head and the post-merge checkout.Follow-ups identified by the broader audit: prepared static catalogs still repeat per-row provider setup, and Gateway thinking-profile projection repeats cached/uncached assembly. Those are separate owners with their own lazy-resolution and lifecycle invariants, not part of this command refactor.