Repository navigation
fix(gateway): start with providers without models after #143837 - #144599
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, 11:19 PM ET / September 11, 2026, 03:19 UTC (Revision 3). ClawSweeper reviewWhat this changesAllow Gateway startup when bundled-provider settings omit custom models, with regression coverage for inherited catalogs, current credentials, and public readiness. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: current main still has the startup failure, and this focused repair preserves the existing catalog and credential contracts. No actionable patch defects were found. Priority: P1 Review scores
Verification
How this fits togetherThe model registry combines bundled catalogs and configured provider settings into the models available to OpenClaw. Gateway startup prepares this registry before exposing a ready service. flowchart TD
A[Provider settings] --> C[Model registry]
B[Inherited model catalogs] --> C
C --> D{Custom models present?}
D -->|Yes| E[Compose custom and inherited rows]
D -->|No| F[Retain inherited rows]
E --> G[Apply current request settings]
F --> G
G --> H[Gateway ready]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +89. Total +89 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep optional model rows optional throughout catalog composition while retaining inherited inventory and current request settings. Do we have a high-confidence way to reproduce the issue? Yes: valid bundled-provider settings can reach the unconditional map with models undefined; the PR records the matching startup failure. This review verified the source path without running it. Is this the best way to solve the issue? Yes: optional mapping repairs the existing composition owner without changing schema, defaults, catalog membership rules, or credential precedence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e62272f04a3e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Thanks @obviyus! Proof: Real isolated Gateway startup, refreshed and cached catalog reads with 10 bundled provider models, 61 focused test cases, and exact-head review and CI.
Provider-level |
## What Problem This Solves A provider entry without custom model rows passed synthetic coverage and then crashed a Gateway. This maintainer-requested corpus makes real operator configuration shapes part of pull-request validation. Related: #144599 ## Why This Change Was Made The suite loads two sanitized operator configurations and eight canonical shapes through shared Doctor normalization, the Gateway startup snapshot owner, prepared static catalog construction, and provider login-choice resolution. It preserves absent optional model lists so normalization cannot hide the startup regression. The existing core CI checks run this corpus on core changes. ## User Impact No production behavior changes. New startup regressions in retained operator config shapes fail CI before landing. ## Evidence - The missing-list cases fail on the baseline at the same registry call as a real Gateway startup. - Final rebased head: 13 focused tests pass, including the corpus and a legacy-provider sibling. The same command used by CI passes. - All ten fixtures pass real Gateway startup, CLI listing, full-inventory RPC, webchat command responses, and browser rendering. The multi-agent fixture also exercises both agents. - Telegram Test Server proof covers the provider picker, owner login choices, and non-owner rejection with zero model requests. - Corpus runs use synthetic credentials and loopback-only network namespaces. Private plugin configuration uses an inert fixture plugin. - Legacy API aliases require `doctor --fix` before direct startup; recovery is covered. - The requested local source config was absent. Both available remote operator sources are retained, with structure-preserving sanitization. Co-authored-by: Ayaan Zaidi <[email protected]>
… (openclaw#144599) ## What Problem This Solves Fixes an issue where Gateway startup fails after plugin auto-enable when a bundled provider has credentials or settings but no custom `models` array. This addresses an operator report of a regression introduced by openclaw#143837. The reported provider-level `enabled` keys are not accepted by the current schema. The valid credentials-only form reproduces the crash when startup automatically enables a configured channel. ## Why This Change Was Made The catalog composition owner now maps custom rows only when they exist. Existing merge logic keeps inherited catalog rows and routes, and the provider loop still applies current request credentials and headers. No schema or configuration keys change. ## User Impact Operators can start the Gateway with provider settings that omit custom models, including when a channel is automatically enabled. Bundled models remain available to catalog browsing. ## Evidence - Pinned main `7a28adad1faf`: real isolated Gateway startup exits 1 with `TypeError: Cannot read properties of undefined (reading 'map')` at `ModelRegistry.loadModels`, introduced in openclaw#143837. - Both new regression tests fail on the original code at that same call. The composition test verifies inherited rows, routes, token limits, and current credentials/headers. The Gateway test waits for full startup and then requests public readiness. - Fixed code passes 61 focused tests across catalog composition, the model-catalog sibling, the Gateway catalog-startup suite, and the neighboring WebSocket contract. - Real CLI proof: Gateway reaches readiness; explicit catalog refresh exposes 10 bundled OpenAI models; the following list without refresh retains those rows. Credential status reports the synthetic sources. Fake keys leave models unavailable and provider discovery incomplete; no successful upstream authentication is claimed. - The exact reported `enabled` shape remains rejected before startup on both revisions. The channel token is synthetic, and channel connections are disabled; this is startup proof, not message-delivery proof. - Changed-file formatter, lint, line-count and assertion checks pass. Typechecks and full suites run in GitHub CI. Co-authored-by: Ayaan Zaidi <[email protected]>
…144626) ## What Problem This Solves A provider entry without custom model rows passed synthetic coverage and then crashed a Gateway. This maintainer-requested corpus makes real operator configuration shapes part of pull-request validation. Related: openclaw#144599 ## Why This Change Was Made The suite loads two sanitized operator configurations and eight canonical shapes through shared Doctor normalization, the Gateway startup snapshot owner, prepared static catalog construction, and provider login-choice resolution. It preserves absent optional model lists so normalization cannot hide the startup regression. The existing core CI checks run this corpus on core changes. ## User Impact No production behavior changes. New startup regressions in retained operator config shapes fail CI before landing. ## Evidence - The missing-list cases fail on the baseline at the same registry call as a real Gateway startup. - Final rebased head: 13 focused tests pass, including the corpus and a legacy-provider sibling. The same command used by CI passes. - All ten fixtures pass real Gateway startup, CLI listing, full-inventory RPC, webchat command responses, and browser rendering. The multi-agent fixture also exercises both agents. - Telegram Test Server proof covers the provider picker, owner login choices, and non-owner rejection with zero model requests. - Corpus runs use synthetic credentials and loopback-only network namespaces. Private plugin configuration uses an inert fixture plugin. - Legacy API aliases require `doctor --fix` before direct startup; recovery is covered. - The requested local source config was absent. Both available remote operator sources are retained, with structure-preserving sanitization. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #143837.
What Problem This Solves
Gateway startup could crash after plugin auto-enable when a bundled provider had credentials or settings but no custom models array.
Why This Change Was Made
The catalog composition owner maps custom rows only when present. Existing merge logic preserves inherited rows and routes while applying current request credentials and headers.
User Impact
Provider settings can omit custom models, including when startup enables a configured channel. Bundled models remain available. Provider-level enabled keys remain invalid; no schema or configuration keys change.
Evidence
Real isolated startup and both new regressions failed before the fix at the same missing-array read. All 61 focused catalog, startup, and connection tests passed afterward. The Gateway reached readiness; explicit catalog refresh exposed ten bundled models, and a passive list retained them. Synthetic credentials left the models unavailable, so upstream authentication was not proved. Channel connections were disabled. Formatting, lint, and structural checks passed.