Repository navigation
fix(models): keep dynamic model lists consistent across CLI and Gateway - #114393
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 27, 2026, 3:28 AM ET / 07:28 UTC. ClawSweeper reviewWhat this changesThis PR makes the lifecycle-prepared model catalog the shared source for CLI, Gateway, and picker model views, while migrating generated plugin catalogs from agent sidecar files into the existing per-agent SQLite cache with Doctor-owned recovery. Merge readinessThe patch appears to provide a coherent single prepared-catalog path and includes credible real Gateway proof, so no line-level correctness defect is established. It should remain open for the protected Priority: P2 Review scores
Verification
How this fits togetherProvider discovery and authentication information feed a prepared model catalog that is projected into CLI commands, Gateway flowchart LR
Providers[Provider discovery and auth] --> Prepared[Prepared model catalog]
Sidecars[Released catalog sidecars] --> Doctor[Doctor migration]
Doctor --> AgentDb[Per-agent SQLite cache]
AgentDb --> Prepared
Prepared --> CLI[CLI model list]
Prepared --> Gateway[Gateway models list]
Prepared --> Picker[Model picker]
Decision needed
Why: The implementation moves credential-bearing state across a persistence boundary. The supplied follow-up says this was approved, but the PR is externally associated and protected by the Before merge
Findings
Agent review detailsSecurityNeeds attention: No concrete insecure file-permission defect is established, but moving potentially credential-bearing catalog JSON into SQLite is a merge-critical storage and retention boundary that requires verified maintainer approval. PR surfaceSource -82, Tests +677, Other -1. Total +594 across 32 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only after a verified maintainer confirms that per-agent Do we have a high-confidence way to reproduce the issue? Yes, at source level: the prior CLI source-plan and provider-preview paths could project a different catalog from the prepared Gateway/registry generation. The supplied PR evidence also describes a real built-Gateway comparison, but this review did not independently rerun it. Is this the best way to solve the issue? Yes, provisionally: projecting CLI and Gateway from one lifecycle-prepared catalog removes the competing discovery planners rather than adding another synchronization layer. The SQLite migration is only the best complete solution if a maintainer confirms the credential-retention contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 00175666189e. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What 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
History |
|
Addressing the ClawSweeper rank-up moves and maintainer decision before landing:
|
|
Maintainer/storage-owner confirmation for the updated head |
|
Merged via squash.
|
…ay (openclaw#114393) * fix(models): unify prepared catalogs and safe migration * refactor(models): remove obsolete prepared catalog paths
What Problem This Solves
Fixes an issue where users browsing dynamically discovered models through the CLI, Gateway, or model picker could see stale, missing, or inconsistent models, provider aliases, authentication status, and OpenAI account routes after provider refresh or upgrade.
Why This Change Was Made
The lifecycle-owned prepared model catalog is now the single source of truth for CLI rows, Gateway model lists, static provider entries, aliases, and physical authentication routes. Generated provider catalogs move into the existing per-agent SQLite cache with an additive, verified migration that preserves released credentials, handles unreadable or concurrently superseded sidecars, atomically claims migrated source inodes, and keeps unrelated providers available;
doctor --fixowns explicit repair. The change removes the duplicate discovery planners, provider previews, obsolete fallbacks, and an oversized-file baseline entry. It adds no SQLite schema-version change, protocol bump, or configuration surface.User Impact
The CLI, Gateway, and model picker show the same current models; static entries, canonical aliases, and account-specific routes remain selectable. Existing provider credentials and healthy configured models remain available during upgrades, concurrent refreshes, unreadable sidecars, or an isolated corrupt provider catalog.
Evidence
doctor --fix.pnpm check:changed, productionpnpm build, and real 32-request Gateway stress all pass on the pushed commit.models.listprojections agree with CLI results; 32 concurrent authenticated WebSocket requests succeed with identical catalogs.codex-rs/app-server/src/models.rs,codex-rs/app-server/src/models_refresh_worker.rs,codex-rs/app-server/src/request_processors/catalog_processor.rs, andcodex-rs/app-server/tests/suite/v2/model_list.rsat95637f7056835fea66bdd0044414af480fc0fd74; remote catalog generations are authoritative and atomically replaced.33032174cf82: removed the obsolete provider-preview planner, supplemental manifest fallback, and unused exported catalog APIs; 44 insertions and 218 deletions (174 net fewer lines).pnpm deadcode:full,pnpm deadcode:exports, andpnpm deadcode:unused-filesall pass; production, full-tree, and script audits report zero unused exports or unused files.