Skip to content

refactor(models): remove superseded catalog paths - #144342

Merged
obviyus merged 4 commits into
mainfrom
refactor/models-dead-path-sweep
Sep 10, 2026
Merged

obviyus merged 4 commits into
mainfrom
refactor/models-dead-path-sweep

Conversation

@obviyus

@obviyus obviyus commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Sep 10, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 3:48 PM ET / 19:48 UTC.

ClawSweeper review

What this changes

Removes 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
Reviewed head: 15d7a9f32983ca6b355ceefed0395c0d4b215039

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused cleanup with preserved behavioral coverage, reported before/after runtime observations, and no actionable defect found.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.
Evidence reviewed 9 items Introduced scope and remaining necessity: The pinned merge-base-to-head diff contains the stated cleanup. Current main still contains the configured-list adapter, discarded ambient candidate, and document wrapper; the latest release also contains the adapter and ambient module. This cleanup is not already incorporated.
Equivalent Doctor composition: The migrated call preserves the configuration, metadata snapshot, disabled runtime normalization, and provider canonicalizer previously supplied by the adapter. The registered Doctor model-reference check still calls this inspector.
Onboarding deletion boundary: The sole production caller previously filtered ambient candidates to the two API-key kinds. Native CLI detection and its separate credential observation remain intact. The reviewed equivalence follows from OpenClaw's filtering and call graph, without assuming a Codex credential-format or runtime contract.
Findings None None.
Security None None.

How this fits together

OpenClaw 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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -50, Tests -38. Total -88 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 12 62 -50
Tests 6 203 241 -38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 215 303 -88

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is bounded internal cleanup with preserved user-facing behavior and no demonstrated urgent defect.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.

Label justifications:

  • P3: This is bounded internal cleanup with preserved user-facing behavior and no demonstrated urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports baseline and final-head CLI model output and real Control UI picker selection preserving the configured model and tags; source tracing confirms the removed onboarding and PDF paths did not control those runtime decisions.

Evidence

What I checked:

  • Introduced scope and remaining necessity: The pinned merge-base-to-head diff contains the stated cleanup. Current main still contains the configured-list adapter, discarded ambient candidate, and document wrapper; the latest release also contains the adapter and ambient module. This cleanup is not already incorporated. (src/commands/models/list.configured.ts:9, 341b759ae6bd)
  • Equivalent Doctor composition: The migrated call preserves the configuration, metadata snapshot, disabled runtime normalization, and provider canonicalizer previously supplied by the adapter. The registered Doctor model-reference check still calls this inspector. (src/commands/models/model-reference-validation.ts:76, 15d7a9f32983)
  • Onboarding deletion boundary: The sole production caller previously filtered ambient candidates to the two API-key kinds. Native CLI detection and its separate credential observation remain intact. The reviewed equivalence follows from OpenClaw's filtering and call graph, without assuming a Codex credential-format or runtime contract. (src/commands/onboard-inference.ts:228, 15d7a9f32983)
  • PDF and public SDK remain intact: Current-main references to modelSupportsDocument are exclusively its definition and tests. PDF execution uses providerSupportsNativePdf, while the SDK exports modelSupportsVision and findModelInCatalog rather than the removed wrapper. (src/plugin-sdk/agent-runtime.ts:35, 15d7a9f32983)
  • Retained coverage: The introduced tests preserve configured roles, aliases, wildcard exclusion, retired model normalization, and source-manifest alias recovery. Existing onboarding tests preserve selected-home isolation and unverified credential status; PDF execution tests retain native rejection and extraction fallback coverage. (src/agents/configured-model-entries.test.ts:88, 15d7a9f32983)
  • Shared projection history: The configured-model projection and original-key alias transfer appear in this commit's patch against its raw recorded parent. Broader history also identifies recent catalog work by Ayaan Zaidi and earlier alias work by Vincent Koc; some deeper history reads encountered unavailable blobs. (src/agents/configured-model-entries.ts:66, 3e0c980aaf4f)

Likely related people:

  • Peter Steinberger: Raw commit 3e0c980 adds src/agents/configured-model-entries.ts:66 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3e0c980aaf4f; files: src/agents/configured-model-entries.ts)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus
obviyus merged commit b04bdee into main Sep 10, 2026
189 checks passed
@obviyus
obviyus deleted the refactor/models-dead-path-sweep branch September 10, 2026 19:58
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in b04bdee.

Proof: baseline and final-head models list and Control UI picker checks preserve the configured model and its tags. Exact-head review passed without findings; CI passed.

  • Problem: leftover adapters and test-only paths remained after the catalog extraction.
  • Cleanup: Doctor calls the existing projection and alias owners directly; discarded ambient credential detection and the unused document predicate are removed.
  • Coverage: configured-model and alias tests moved to their owners, including a verified alias-loss failure case.
  • Scope: four listed files retired, 26 retained with reasons in the PR table; production −50 lines, tests −38 lines.
Before After
Model listing and picker selection work, with obsolete internal paths present. The same visible results work through the existing owners, with those paths removed.

obviyus added a commit that referenced this pull request Sep 11, 2026
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…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]>
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant