Repository navigation
fix(models): share model support checks across selection and spawn - #150128
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: blocked before merge. Reviewed September 17, 2026, 2:50 AM ET / 06:50 UTC (Revision 7). ClawSweeper reviewWhat this changesShares model-support checks across child-agent creation, model resolution, prompt aliases, and pickers, and extends Doctor repair to retired native xAI selections. Merge readiness⛔ Blocked before merge - 5 items remain This PR remains useful: current main still accepts endpoint-only native model fallbacks and does not retire native API xAI auto selections. No discrete blocking code defect was found. The updated evidence resolves the earlier package-verification gap, while the intentional compatibility change still warrants owner acceptance. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw combines saved model choices, provider catalogs, account information, and plugin metadata before starting an agent. These changes make selection, child-agent creation, picker visibility, and Doctor repair consume consistent support and retirement decisions. flowchart TD
A[Saved choices and aliases] --> C[Prepared model and account facts]
B[Provider catalogs and plugin metadata] --> C
C --> D[Support and retirement checks]
D --> E[Agent and child creation]
D --> F[Picker and prompt aliases]
D --> G[Doctor repair or recovery guidance]
Decision needed
Why: The implementation and PR body deliberately change an established acceptance path; successful upgrade examples establish coverage but cannot decide whether that broader compatibility tradeoff is acceptable. Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one support owner and route-specific retirement repair, preserving default compatibility for unlisted native IDs unless the responsible owner explicitly accepts their rejection. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: a saved xAI auto alias on the native API can pass endpoint-only fallback acceptance, while main's retirement rule covers only the subscription host. This review did not execute the reproduction. Is this the best way to solve the issue? The shared resolver and retirement owner are a sound repair direction; whether rejecting every unlisted native ID is the best scope remains a compatibility decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b9739cc48c0. LabelsLabel 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
HistoryReview history (6 earlier review cycles)
|
|
Proof: Published 2026.9.3 and 2026.9.4 upgrades, 26 Doctor commands, and 20 Telegram controls passed on the final package.
|
…penclaw#150128) Model resolution, both spawn paths, catalog publication, aliases, and Doctor change together so unsupported selections cannot bypass the shared decision. Most added lines are regression tests. ## What Problem This Solves A saved `Grok → xai/auto` alias could create a child that the native API rejected. A custom provider name could also make retired native `auto` appear usable in the picker. Provider recognition and an endpoint URL were being treated as model support. Refs openclaw#115617, openclaw#142136. ## Why This Change Was Made Spawn and prepared aliases use the existing model resolver. Catalog publication and Doctor consume the same compiled retirement rules for the selected route. The catalog uses main's shared projection owner from openclaw#150509. Prepared aliases have one writer; Doctor keeps its existing config and session writers. ## User Impact Unsupported explicit choices fail before child creation with recovery guidance. Automatic choices retain their primary and fallback order. Picker views omit known retired routes; the admin inventory retains saved definitions. Custom endpoints and logical provider/account choices remain intact. ## Compatibility Native IDs need a definition, catalog support, or provider-owned resolution. This deliberately replaces openclaw#125931's endpoint-only inference: previously accepted unlisted native IDs need explicit definitions when their provider cannot resolve them. Custom/local endpoints, authored private models, and models supplied by native runtimes remain supported. Doctor repairs known retirements, preserves account pins and allowlists, and retains unresolved choices with guidance. It does not invent definitions for unverified IDs. No new configuration keys, schema, or protocol changes. ## Evidence - The real Gateway regression fails with the browse filter removed and passes with it restored: retired native `personal/auto` disappears, while custom endpoint and admin inventory controls remain intact. Command: `node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server.models-native-retirement.test.ts`. - Final package `08e2f6002888` passed upgrades driven by published 2026.9.3 and 2026.9.4, followed by candidate startup and existing/new/custom conversations. Both preserved the seven original transcript events. All 26 Doctor commands passed, including repeated repair, logical native aliases, custom models, account pins, and allowlists. - Both upgraded fixtures passed all 10 Telegram Test Server controls: retired/unknown rejection, native/custom/friendly-alias completion, and correct picker buttons. The previously missing 2026.9.3 custom-model reply is now observed. - Four final-build Gateway cases passed: native account/history continuity, saved-token selection, a new reply across a 60-second process freeze, and recovery after a settled failure. Each matched exactly one intended test and left no child processes. - Source coverage includes 172 model/Doctor/Gateway tests, 220 affected fixture tests, and focused delivery, hook, lifecycle, and compaction checks; these counts overlap. Production/test types, lint, formatting, size limits, assertion limits, exports, architecture, and test registration checks passed. Limits: updater tests use `--no-restart` followed by separate candidate startup. The first 2026.9.3 update hit its shipped 30-second package-scan limit; the retained installation was verified intact, and one normal retry after a measured 11-second scan succeeded. Telegram uses the real Test Server with local model fixtures. An extra final-package fallback run completed through the Gateway and Telegram accepted its sends, but the recorder timed out before capturing user-side receipt; that run is not counted as passed. Earlier `b12d66a91bc1` fallback runs retain their original identity and successful observations. ## Consumers Visible/background spawn, prompt aliases, model materialization, picker publication, and Doctor use the shared support facts. No public SDK contract changes. ## Invalidation Existing config, catalog, account, and plugin owners control freshness. Alias hints belong to the prepared turn snapshot. Admission rechecks freshness after asynchronous resolution. ## Tests Coverage includes native/custom/private models, selected routes, namespace identity, pins, fallback order, stale generations, and repeated Doctor repair. A separate follow-up answer defect from openclaw#149223 remains behind openclaw#126263's task-ownership prerequisite; its assertion remains active and this PR does not claim to fix it. ## Screenshots Packaged comparison at `b12d66a91bc1`: native Personal Auto is removed, while custom Private Auto remains. | Before | After | | --- | --- | |  |  | Final-package model-list responses match both pictured comparisons. The native metadata remains readable: model name, 1M context, and Medium thinking. | Before | After | | --- | --- | |  |  | <details> <summary>Production changes: +705 lines</summary> The added code implements shared admission, native alias support, and Doctor repair. It adds no state manager or configuration surface. | File | Net | Responsibility | | --- | ---: | --- | | `cli-runner/helpers.ts` | +4 | Pass prepared aliases | | `cli-runner/prepare.ts` | 0 | Use async prompt preparation | | `cli-runner/prompt-context.ts` | +33 | Capture the existing prepared owner | | `model.configured-fallback.ts` | +10 | Apply shared support rules | | `model.configured-overrides.ts` | +60 | Validate selected transport support | | `model.provider-hooks.ts` | -55 | Defer hook binding through the existing resolver | | `model.provider-hooks.types.ts` | +31 | Keep existing hook types separate | | `model.provider-transport.ts` | +35 | Relocate existing transport resolution | | `model.registry-resolution.ts` | -40 | Remove competing resolution paths | | `model.static-catalog-row.ts` | +36 | Relocate existing row conversion | | `model.static-catalog.ts` | +64 | Reuse canonical native metadata | | `model.static-catalog.types.ts` | +2 | Keep donor facts in the existing cache | | `model.ts` | +13 | Share resolution and recovery errors | | `prepared-compaction-runtime.ts` | +1 | Pass prepared aliases | | `attempt-system-prompt-prepare.ts` | +1 | Pass prepared aliases | | `model-catalog-visibility.ts` | +20 | Filter retirement after route projection | | `model-runtime-choice.ts` | +224 | Share admission across spawn paths | | `openclaw-tools.ts` | 0 | Use current session configuration | | `prepared-model-runtime.configured-completion.ts` | +88 | Prepare aliases without inventing catalog rows | | `prepared-model-runtime.full-catalog.ts` | +9 | Publish captured alias facts | | `prepared-model-runtime.types.ts` | +2 | Represent derived alias facts | | `materialize-model.ts` | +4 | Share final route validation | | `subagent-spawn-child-plan.ts` | -96 | Remove separate admission checks | | `subagent-spawn-deps.ts` | -3 | Remove obsolete dependency surface | | `subagent-spawn-plan.ts` | +42 | Consume shared admission | | `subagent-spawn.runtime.ts` | -1 | Remove obsolete argument | | `system-prompt-config.ts` | -2 | Render supplied facts only | | `sessions-spawn-visible.ts` | 0 | Use common async admission | | `commands-models.ts` | -4 | Use captured retirement metadata | | `commands-system-prompt.ts` | +8 | Capture prompt facts before rendering | | `model-runtime-normalization.ts` | +9 | Relocate existing normalization | | `codex-route-session-repair.ts` | 0 | Use the session repair module | | `retired-model-ref-repair.ts` | +8 | Use selected-route retirement policy | | `retired-session-model-repair.ts` | +59 | Relocate existing session repair | | `models-list-result.ts` | +1 | Pass captured metadata | | `manifest-model-suppression.ts` | +136 | Compile native retirement policy once | | `manifest-model-suppression.types.ts` | +6 | Carry effective route facts | </details> Co-authored-by: Ayaan Zaidi <[email protected]>
Model resolution, both spawn paths, catalog publication, aliases, and Doctor change together so unsupported selections cannot bypass the shared decision. Most added lines are regression tests.
What Problem This Solves
A saved
Grok → xai/autoalias could create a child that the native API rejected. A custom provider name could also make retired nativeautoappear usable in the picker. Provider recognition and an endpoint URL were being treated as model support. Refs #115617, #142136.Why This Change Was Made
Spawn and prepared aliases use the existing model resolver. Catalog publication and Doctor consume the same compiled retirement rules for the selected route. The catalog uses main's shared projection owner from #150509. Prepared aliases have one writer; Doctor keeps its existing config and session writers.
User Impact
Unsupported explicit choices fail before child creation with recovery guidance. Automatic choices retain their primary and fallback order. Picker views omit known retired routes; the admin inventory retains saved definitions. Custom endpoints and logical provider/account choices remain intact.
Compatibility
Native IDs need a definition, catalog support, or provider-owned resolution. This deliberately replaces #125931's endpoint-only inference: previously accepted unlisted native IDs need explicit definitions when their provider cannot resolve them. Custom/local endpoints, authored private models, and models supplied by native runtimes remain supported. Doctor repairs known retirements, preserves account pins and allowlists, and retains unresolved choices with guidance. It does not invent definitions for unverified IDs. No new configuration keys, schema, or protocol changes.
Evidence
personal/autodisappears, while custom endpoint and admin inventory controls remain intact. Command:node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server.models-native-retirement.test.ts.08e2f6002888passed upgrades driven by published 2026.9.3 and 2026.9.4, followed by candidate startup and existing/new/custom conversations. Both preserved the seven original transcript events. All 26 Doctor commands passed, including repeated repair, logical native aliases, custom models, account pins, and allowlists.Limits: updater tests use
--no-restartfollowed by separate candidate startup. The first 2026.9.3 update hit its shipped 30-second package-scan limit; the retained installation was verified intact, and one normal retry after a measured 11-second scan succeeded. Telegram uses the real Test Server with local model fixtures. An extra final-package fallback run completed through the Gateway and Telegram accepted its sends, but the recorder timed out before capturing user-side receipt; that run is not counted as passed. Earlierb12d66a91bc1fallback runs retain their original identity and successful observations.Consumers
Visible/background spawn, prompt aliases, model materialization, picker publication, and Doctor use the shared support facts. No public SDK contract changes.
Invalidation
Existing config, catalog, account, and plugin owners control freshness. Alias hints belong to the prepared turn snapshot. Admission rechecks freshness after asynchronous resolution.
Tests
Coverage includes native/custom/private models, selected routes, namespace identity, pins, fallback order, stale generations, and repeated Doctor repair. A separate follow-up answer defect from #149223 remains behind #126263's task-ownership prerequisite; its assertion remains active and this PR does not claim to fix it.
Screenshots
Packaged comparison at
b12d66a91bc1: native Personal Auto is removed, while custom Private Auto remains.Final-package model-list responses match both pictured comparisons. The native metadata remains readable: model name, 1M context, and Medium thinking.
Production changes: +707 lines
The added code implements shared admission, native alias support, and Doctor repair. It adds no state manager or configuration surface.
cli-runner/helpers.tscli-runner/prepare.tscli-runner/prompt-context.tsmodel.configured-fallback.tsmodel.configured-overrides.tsmodel.provider-hooks.tsmodel.provider-hooks.types.tsmodel.provider-transport.tsmodel.registry-resolution.tsmodel.static-catalog-row.tsmodel.static-catalog.tsmodel.static-catalog.types.tsmodel.tsprepared-compaction-runtime.tsattempt-system-prompt-prepare.tsmodel-catalog-visibility.tsmodel-runtime-choice.tsopenclaw-tools.tsprepared-model-runtime.configured-completion.tsprepared-model-runtime.full-catalog.tsprepared-model-runtime.types.tsmaterialize-model.tssubagent-spawn-child-plan.tssubagent-spawn-deps.tssubagent-spawn-plan.tssubagent-spawn.runtime.tssystem-prompt-config.tssessions-spawn-visible.tscommands-models.tscommands-system-prompt.tsmodel-runtime-normalization.tscodex-route-session-repair.tsretired-model-ref-repair.tsretired-session-model-repair.tsmodels-list-result.tsmanifest-model-suppression.tsmanifest-model-suppression.types.ts