Repository navigation
refactor(models): remove superseded catalog paths - #144342
Conversation
|
🦞👀 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, 3:48 PM ET / 19:48 UTC. ClawSweeper reviewWhat this changesRemoves unused model-catalog helpers and a discarded onboarding credential scan, connects Doctor directly to existing model-reference owners, and relocates retained tests. Merge readiness✅ Ready for maintainer review This remains useful, bounded cleanup that current main has not incorporated. No introduced correctness defect was found, and the maintainer label protects it from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw projects configured models and provider metadata into model lists and Doctor diagnostics. Onboarding separately combines environment credentials and installed CLI observations into setup candidates. flowchart TD
A[Configured models] --> C[Shared model projection]
B[Provider alias metadata] --> C
C --> D[Doctor model diagnostics]
E[Environment API keys] --> G[Onboarding candidates]
F[Installed CLI observations] --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -50, Tests -38. Total -88 across 11 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the shared projection and alias owners authoritative while retiring unreachable adapters and preserving existing onboarding and PDF behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor reports no user-visible bug; source inspection confirms the obsolete paths and equivalent retained composition. Is this the best way to solve the issue? Yes. Removing the unused wrappers and moving coverage to existing owners is a narrow solution that preserves the current contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 341b759ae6bd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landed in b04bdee. Proof: baseline and final-head
|
Related: #136257, #144342, #144563 ## What Problem This Solves This maintainer-requested follow-up removes redundant test setup and two obsolete file boundaries after the auth and prepared-catalog cutovers. The older extraction deleted larger suites, but most current tests now protect behavior added or changed by the landed owners. ## Why This Change Was Made Move named-login assertions to the command boundary and make `resolveLoginProfiles` private. Consolidate duplicate auth, account-preview, and catalog cases. Move the unchanged output-flag guard into the shared command module, which its callers already import. The native-auth audit found remaining core credential consumers in setup, status, and execution identity. The plugin's non-secret login-status probe does not yet serve every consumer, so this PR retains those readers. The Codex migration provider still owns explicit auth and memory import. ## User Impact No behavior change. Model listing, output-flag validation, named profiles, account-preview recovery, and native sign-in status keep their current behavior. No schema, config, protocol, dependency, or compatibility path is added. ## Evidence - 241 focused tests passed across 11 command, login integration, persistence, reply, and UI suites. After the final rebase, all 143 tests in the six affected suites passed again; unchanged proof is retained. - Before/after `pnpm openclaw models list` and authenticated Gateway `models.list` return the same available fixture model. Conflicting `--json --plain` still fails with the same message. - Native sign-in status remains signed out in the isolated fixture. No interactive sign-in or inference claim is made. - Formatting, targeted type-aware lint, line-count/environment-count checks, assertion checks, and `git diff --check` passed. Fresh source review found no substantive findings. - Production delta is -1 line; tests are -160 lines. The patch adds 95 lines and deletes 256, including two whole files. ### File disposition | Requested file | Disposition | Reason or retained owner | | --- | --- | --- | | `src/commands/models/auth.test.ts` | Retain; consolidate duplicates | Manual input, method selection, force ordering, target agents, saved-state errors and defaults remain live. Named-profile cases move here. | | `ui/src/pages/new-session/model-control.metadata-lifecycle.test.ts` | Retain; remove one duplicate row | Retry coverage already proves rejected previews block; account confirmation, retirement, reconnect and remount cases remain. | | `src/gateway/server-methods/models-list-result.cli-runtime-availability.test.ts` | Retain | No full replacement for Gateway native/provider separation, plugin gates, and personal account precedence. | | `src/gateway/server-methods/models-list-result.provider-outcomes.test.ts` | Retain | Empty-catalog rejections, selected-account matching and public reason/deadline projection remain distinct. | | `src/auto-reply/reply/commands-models.catalog-recovery.test.ts` | Retain; remove two duplicates | The timer variant never delayed acquisition; the singleton tested only default retention already covered through public replies. | | `src/gateway/server-methods/models-list-result.plugin-runtime.test.ts` | Retain | Actual handler registry/generation races and preloaded chat composition remain live. | | `src/auto-reply/reply/directive-handling.auth.ts` | Untouched | Assigned to the separate prepared-auth endpoint lane. | | `src/auto-reply/reply/directive-handling.auth.test.ts` | Untouched | Stays with that lane. | | `src/agents/prepared-model-catalog-worker.test.ts` | Retain | Artifact-mode and synthetic-auth request identities lack complete replacement coverage. | | `extensions/codex/src/migration/provider.ts` | Retain | Registered by the plugin and migration artifact; explicit auth/memory import still needs it. | | `src/commands/models/auth.login-profiles.test.ts` | Delete; migrate assertions | Named override and ambiguous-result rejection move to command tests; ordinary login already covers pass-through. | | `src/auto-reply/reply/directive-handling.model-picker.ts` | Untouched | Assigned to the separate prepared-auth endpoint lane. | | `src/auto-reply/reply/directive-handling.model-picker.test.ts` | Untouched | Stays with that lane. | | `src/commands/models/list.options.ts` | Delete; move implementation | Shared command owner keeps the same guard and all four callers. | ### Assertion ledger - Named-profile override and multi-profile rejection now run through `modelsAuthLoginCommand`, including persistence/order/output and no-write failure assertions. - Provider-issued profile pass-through remains in the ordinary login test and registered CLI integration. - Protected-token mock forwarding is replaced by retained actual store/reference/audit proof in `provider-auth-persistence.test.ts` and generic token-command dispatch. - Configured-order promotion remains in the registered CLI integration, which reads the actual shared/local stores. - Invalid-method tests share one table and retain both omitted-force and forced cases, with no login or purge. - The failed-preview row remains covered by the stronger same-account retry test in the same UI file. - Native bound-model/default visibility remains in four public reply cases after removing the duplicate timer row and default-only singleton. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: openclaw#136257 ## What Problem This Solves This maintainer-requested sweep retires leftover catalog adapters and dead paths after the catalog and native sign-in landings. It classifies all 30 requested files against current callers and the original replacement. Four files can be retired; 26 still carry behavior, protected login work, or newer regression coverage. ## Why This Change Was Made Doctor now calls the existing configured-model projection and provider-alias owner directly. Onboarding no longer reads a credential file to create a candidate that its only caller discarded. The unused document-capability wrapper and its test-only callers are removed. Configured-model tests move to the projection and alias owners, preserving role tags, aliases, wildcard exclusion, retired model normalization, and stale distribution metadata recovery. ## User Impact Model listing and model selection retain their current behavior. The change removes 50 production lines and 38 test lines overall (215 additions, 303 deletions). Login lanes, live native readiness, Gateway publication tests, and UI settings helpers remain intact. No configuration, schema, protocol, or dependency change is included. ## Evidence - Baseline: 181 focused tests passed across eight suites. After the required rebase: 182 tests passed across nine suites, plus the new first-wins catalog sibling. The final scope correction retained the existing output-mode helper; its two CLI suites passed all 20 tests on the final head. - Alias discrimination: temporarily removing original-key alias transfer made the retained alias test fail with an empty alias list. The source was restored before final builds. - Formatting, 230 syntax lint rules, line-count and assertion-safety checks, and git diff --check passed. Full typechecking is assigned to GitHub CI. - Combined runtime and Control UI builds passed on the isolated test host. Final build: 49.88 seconds. - Baseline and final-head pnpm openclaw models list returned the configured synthetic model with default/configured/alias tags. - Baseline and final-head Control UI /new picker displayed and selected that model. Accessibility trees and screenshots were inspected. The final server process and UI connection were verified against commit 15d7a9f. No live chat delivery behavior changes. ## Per-file disposition A means removed or moved to an existing owner. B means retained. Source line references for retained files use the intake base; family labels identify the original extraction groups. Relocation alone is not treated as dead code. | File | Decision | Current evidence / missing outcome | | --- | --- | --- | | src/commands/models/auth.test.ts | B: protected | Auth A–H lane owns login changes; explicitly excluded. | | src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts | B: retain | oauth.ts:199,254,407 still delegates refresh and resolves profiles. Missing F15 Auth A/G shared-refresh/native-owner cutover. | | src/agents/auth-profiles/external-oauth.test.ts | B: retain | external-cli-sync.ts:60 and store.ts:1310,1560,1673,1690 retain MiniMax provenance, precedence and snapshot protection. Missing F15 external-auth cutover. | | ui/src/pages/new-session/model-control.metadata-lifecycle.test.ts | B: retain landed proof | Current 453 lines include passive publication, account/agent isolation and lifecycle regressions added after S. model-control.ts:295,415,423 remains live. No missing feature established. | | src/gateway/server-methods/models-list-result.cli-runtime-availability.test.ts | B: retain | Personal pin and execution-owner cases at :183,282 protect current native decisions. F15/F16 decision/assertion replacement has not landed. | | src/gateway/server-methods/models-list-result.provider-outcomes.test.ts | B: retain | Current rejected/empty/cooldown/native reread cases protect model-catalog-decisions.ts:87 and models-list-result.ts:184,556. Missing F12/F15 decision replacement and F45 coverage transfer. | | src/auto-reply/reply/commands-models.catalog-recovery.test.ts | B: retain landed proof | Current 361 lines cover publication retirement, profile restrictions and passive reads through commands-models.ts:176,226,455,646. No missing feature established. | | src/gateway/server-methods/models-list-result.plugin-runtime.test.ts | B: retain | :66,124,157 and models.list entry tests protect passive prepared reads and runtime-generation isolation. Missing F12/F16 native publication cutover. | | src/auto-reply/reply/directive-handling.auth.ts | B: retain | directive-handling.model.ts:101,130,484 calls it. Missing F39/F15 captured providerAuthLabels from prepared catalog view. | | src/auto-reply/reply/directive-handling.auth.test.ts | B: retain | Live resolveAuthLabel coverage for references, AWS and workspace environment. Same F39/F15 gap. | | src/commands/models/list.configured.test.ts | A: move coverage | Shared configured projection and provider-alias canonicalizer own all five cases; test adapter removed. | | src/agents/harness/model-catalog-readiness.ts | B: retain | model-catalog-decisions.ts:251 calls evaluator; generation-local native observations remain. Missing F12/F16 native decision/view cutover. | | src/flows/model-picker.provider-catalog.test.ts | B: retain | Scoped acquisition and alias canonicalization cases :39,99 are not covered by mocked picker consumer. Missing F12/F42 prepared-view cutover. | | src/agents/prepared-model-catalog-worker.test.ts | B: retain | Worker remains at prepared-model-catalog-worker.ts:144,213. Captured ordering, lastGood, generation and fingerprints require F45 assertion transfer. | | src/gateway/server-methods/models-list-configured-static.ts | B: retain | models-list-result.ts:471 and models-list-harness-catalog.ts:43 still use membership/static inclusion. S partly relocated this code; F09/F12 view visibility replacement absent. | | extensions/codex/src/migration/provider.ts | B: retain | index.ts:254 registers owner; migration-provider-api.ts:2 reexports it. S relocated, not eliminated, implementation; F15 G consolidation absent. | | src/commands/models/auth.login-profiles.test.ts | B: protected | Auth A–H lane owns login changes; explicitly excluded. | | src/flows/model-picker.provider-catalog.ts | B: retain | model-picker.ts:212 uses preferred-provider acquisition. S loadPreparedModelCatalogView replacement absent; F12/F42 gap. | | src/auto-reply/codex-login-recovery.ts | B: retain | agent-runner-failure-reply.ts:304, cron/service/failure-alerts.ts:340 and run/payloads.ts:216 call it. Missing F15 provider-login-choice recovery in protected lanes. | | src/gateway/server-methods/models-list-harness-catalog.ts | B: retain | models-list-result.ts:349 calls explicit native refresh/static inclusion. Missing F12/F16 native discovery/view cutover. | | ui/src/pages/model-providers/mutations.ts | B: retain | model-providers-page.ts:435,458,559,588,591 still applies patches. Missing F15 auth-owner writes; S page-mutations.ts absent. | | ui/src/pages/model-providers/probe-results.ts | B: retain | model-providers-page.ts:506,513 uses both exports. S relocation to page-mutations.ts never landed; no missing product behavior established. | | src/commands/onboard-inference-ambient.test.ts | A: delete | Tests only credential-file candidate discarded by onboard-inference.ts:228. Native detection owner already handles stored evidence without claiming verified login. | | src/agents/tools/pdf-tool.model-catalog.test.ts | A: delete | modelSupportsDocument has only test callers. Native PDF routing is pdf-tool.ts:249 and pdf-tool.helpers.ts:45. | | src/auto-reply/reply/directive-handling.model-picker.ts | B: retain | directive-handling.model.ts:540 calls endpoint label. Missing F39 prepared per-model endpoint/API facts. | | src/agents/cli-auth.test-support.ts | B: retain | cli-credentials.test.ts uses core parser, registered by cli-credentials.ts:540. Core readers still serve onboarding, auth epoch/labels and SDK. Missing F15 G reader retirement. | | src/auto-reply/reply/directive-handling.model-picker.test.ts | B: retain | Exact provider identity regression for live endpoint helper. Same F39 gap. | | ui/src/pages/model-providers/model-behavior.ts | B: retain | model-providers-page.ts:621 uses config reader. S relocation to page-mutations.ts absent; no missing product behavior established. | | src/commands/models/list.configured.ts | A: delete | Doctor adapter caller migrates directly to landed resolveConfiguredModelEntries and existing provider alias canonicalizer; exact S migration. | | src/commands/models/list.options.ts | B: retain | Sole active ensureFlagCompatibility implementation; shared.ts only reexports it. S proposed relocation, with no landed replacement. | ## Deletion ledger - list.configured.test.ts parsing/role tags, nested Gemini retirement and wildcard selector exclusion move to src/agents/configured-model-entries.test.ts:5,28,66. Alias-label preservation after canonicalization moves to :88. - list.configured.test.ts manifest provider aliases and stale dist-to-source alias recovery move to src/commands/models/provider-aliases.test.ts:13,36. The production adapter is removed; no coverage is claimed from its absence. - onboard-inference-ambient.test.ts removes the sole credentials=true credential-file assertion with the filtered-out candidate. Retained onboard-inference.test.ts:115-160 checks selected HOME/CODEX_HOME, passive status, unchanged credentials, no token leak and no plugin activation; :236,249,634 protect ordering/unknown status/blank keys. - pdf-tool.model-catalog.test.ts removes all three true/false/undefined assertions for the unused modelSupportsDocument export. model-catalog.test.ts removes only its corresponding import/assertion; image capability remains tested. Native/fallback PDF routing remains in pdf-tool.test.ts:653 and pdf-tool.helpers.test.ts:96-108. Co-authored-by: Ayaan Zaidi <[email protected]>
…law#144589) Related: openclaw#136257, openclaw#144342, openclaw#144563 ## What Problem This Solves This maintainer-requested follow-up removes redundant test setup and two obsolete file boundaries after the auth and prepared-catalog cutovers. The older extraction deleted larger suites, but most current tests now protect behavior added or changed by the landed owners. ## Why This Change Was Made Move named-login assertions to the command boundary and make `resolveLoginProfiles` private. Consolidate duplicate auth, account-preview, and catalog cases. Move the unchanged output-flag guard into the shared command module, which its callers already import. The native-auth audit found remaining core credential consumers in setup, status, and execution identity. The plugin's non-secret login-status probe does not yet serve every consumer, so this PR retains those readers. The Codex migration provider still owns explicit auth and memory import. ## User Impact No behavior change. Model listing, output-flag validation, named profiles, account-preview recovery, and native sign-in status keep their current behavior. No schema, config, protocol, dependency, or compatibility path is added. ## Evidence - 241 focused tests passed across 11 command, login integration, persistence, reply, and UI suites. After the final rebase, all 143 tests in the six affected suites passed again; unchanged proof is retained. - Before/after `pnpm openclaw models list` and authenticated Gateway `models.list` return the same available fixture model. Conflicting `--json --plain` still fails with the same message. - Native sign-in status remains signed out in the isolated fixture. No interactive sign-in or inference claim is made. - Formatting, targeted type-aware lint, line-count/environment-count checks, assertion checks, and `git diff --check` passed. Fresh source review found no substantive findings. - Production delta is -1 line; tests are -160 lines. The patch adds 95 lines and deletes 256, including two whole files. ### File disposition | Requested file | Disposition | Reason or retained owner | | --- | --- | --- | | `src/commands/models/auth.test.ts` | Retain; consolidate duplicates | Manual input, method selection, force ordering, target agents, saved-state errors and defaults remain live. Named-profile cases move here. | | `ui/src/pages/new-session/model-control.metadata-lifecycle.test.ts` | Retain; remove one duplicate row | Retry coverage already proves rejected previews block; account confirmation, retirement, reconnect and remount cases remain. | | `src/gateway/server-methods/models-list-result.cli-runtime-availability.test.ts` | Retain | No full replacement for Gateway native/provider separation, plugin gates, and personal account precedence. | | `src/gateway/server-methods/models-list-result.provider-outcomes.test.ts` | Retain | Empty-catalog rejections, selected-account matching and public reason/deadline projection remain distinct. | | `src/auto-reply/reply/commands-models.catalog-recovery.test.ts` | Retain; remove two duplicates | The timer variant never delayed acquisition; the singleton tested only default retention already covered through public replies. | | `src/gateway/server-methods/models-list-result.plugin-runtime.test.ts` | Retain | Actual handler registry/generation races and preloaded chat composition remain live. | | `src/auto-reply/reply/directive-handling.auth.ts` | Untouched | Assigned to the separate prepared-auth endpoint lane. | | `src/auto-reply/reply/directive-handling.auth.test.ts` | Untouched | Stays with that lane. | | `src/agents/prepared-model-catalog-worker.test.ts` | Retain | Artifact-mode and synthetic-auth request identities lack complete replacement coverage. | | `extensions/codex/src/migration/provider.ts` | Retain | Registered by the plugin and migration artifact; explicit auth/memory import still needs it. | | `src/commands/models/auth.login-profiles.test.ts` | Delete; migrate assertions | Named override and ambiguous-result rejection move to command tests; ordinary login already covers pass-through. | | `src/auto-reply/reply/directive-handling.model-picker.ts` | Untouched | Assigned to the separate prepared-auth endpoint lane. | | `src/auto-reply/reply/directive-handling.model-picker.test.ts` | Untouched | Stays with that lane. | | `src/commands/models/list.options.ts` | Delete; move implementation | Shared command owner keeps the same guard and all four callers. | ### Assertion ledger - Named-profile override and multi-profile rejection now run through `modelsAuthLoginCommand`, including persistence/order/output and no-write failure assertions. - Provider-issued profile pass-through remains in the ordinary login test and registered CLI integration. - Protected-token mock forwarding is replaced by retained actual store/reference/audit proof in `provider-auth-persistence.test.ts` and generic token-command dispatch. - Configured-order promotion remains in the registered CLI integration, which reads the actual shared/local stores. - Invalid-method tests share one table and retain both omitted-force and forced cases, with no login or purge. - The failed-preview row remains covered by the stronger same-account retry test in the same UI file. - Native bound-model/default visibility remains in four public reply cases after removing the duplicate timer row and default-only singleton. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Removes unused catalog adapters and discarded onboarding work left after catalog and native sign-in changes.
Why This Change Was Made
Doctor calls the existing configured-model projection and alias resolver directly. Remove the discarded credential-file candidate and unused document-capability wrapper. Move meaningful projection and alias tests to their existing owners.
User Impact
Model listing and selection retain their behavior while production code shrinks by 50 lines. No configuration, schema, protocol or dependency change.
Evidence
Focused validation passed 182 tests across nine suites, plus a first-wins catalog check; final command-line suites passed 20 tests. An intentionally removed alias transfer made its regression fail. Before/after command-line listing and browser selection returned the same configured model and tags. Runtime/UI builds and focused static checks passed.