Skip to content

fix(gateway): start with providers without models after #143837 - #144599

Merged
obviyus merged 3 commits into
mainfrom
fix/provider-without-models-startup
Sep 11, 2026
Merged

obviyus merged 3 commits into
mainfrom
fix/provider-without-models-startup

Conversation

@obviyus

@obviyus obviyus commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@clawsweeper

clawsweeper Bot commented Sep 11, 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 gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 11:19 PM ET / September 11, 2026, 03:19 UTC (Revision 3).

ClawSweeper review

What this changes

Allow Gateway startup when bundled-provider settings omit custom models, with regression coverage for inherited catalogs, current credentials, and public readiness.

Regression provenance

Possible 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
Reviewed head: 73caca2f9fbaad9234a219fbeb13c6bf933c8890

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful regression tests and relevant recorded Gateway observations supports normal merge readiness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured PR evidence reports the real CLI/Gateway path failing before the fix and reaching readiness afterward with omitted model rows, followed by successful catalog refresh and retained listing results. This covers the changed registry behavior without claiming upstream authentication or Telegram delivery.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR evidence reports the real CLI/Gateway path failing before the fix and reaching readiness afterward with omitted model rows, followed by successful catalog refresh and retained listing results. This covers the changed registry behavior without claiming upstream authentication or Telegram delivery.
Evidence reviewed 8 items Current main still contains the defect: The fetched main revision calls configured.models.map unconditionally during catalog composition. Valid provider overlays can omit this array.
Existing configuration contract: The schema makes models optional for bundled-provider overlays while requiring models and baseUrl for custom providers. Row materialization returns providers with omitted models unchanged.
Repair preserves existing ownership: Optional mapping leaves inherited-row composition and current provider request settings intact. The existing merge helper treats absent explicit rows as empty and retains inherited rows; replace mode still excludes inherited sources.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +89. Total +89 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 89 0 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 90 1 +89

Review metrics

None.

Technical review

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

Labels

Label justifications:

  • P1: A reported current-main regression prevents Gateway startup with valid bundled-provider settings when a channel is automatically enabled.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured PR evidence reports the real CLI/Gateway path failing before the fix and reaching readiness afterward with omitted model rows, followed by successful catalog refresh and retained listing results. This covers the changed registry behavior without claiming upstream authentication or Telegram delivery.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR evidence reports the real CLI/Gateway path failing before the fix and reaching readiness afterward with omitted model rows, followed by successful catalog refresh and retained listing results. This covers the changed registry behavior without claiming upstream authentication or Telegram delivery.

Evidence

What I checked:

  • Current main still contains the defect: The fetched main revision calls configured.models.map unconditionally during catalog composition. Valid provider overlays can omit this array. (src/agents/sessions/model-registry.ts:559, e62272f04a3e)
  • Existing configuration contract: The schema makes models optional for bundled-provider overlays while requiring models and baseUrl for custom providers. Row materialization returns providers with omitted models unchanged. (src/config/zod-schema.core.ts:479, 73caca2f9fba)
  • Repair preserves existing ownership: Optional mapping leaves inherited-row composition and current provider request settings intact. The existing merge helper treats absent explicit rows as empty and retains inherited rows; replace mode still excludes inherited sources. (src/agents/sessions/model-registry.ts:559, 73caca2f9fba)
  • Regression coverage and review continuity: The composition test exercises actual config reading and verifies inherited routes, token limits, and current credentials. The startup test awaits startupSettled and checks HTTP /readyz. GitHub's exact-head commit patch confirms that the latest revision only replaces the previous WebSocket test helper with direct startup and public readiness; the prior review retained no findings. (src/gateway/server.catalog-startup.test.ts:68, 73caca2f9fba)
  • Captured real Gateway observations: The supplied PR body records an isolated pre-fix Gateway failure at the map call and an after-fix CLI run reaching readiness, exposing 10 bundled OpenAI models after refresh, and retaining those rows on the next list. Synthetic credentials and disabled channel connections explicitly limit this to startup/catalog proof. These are contributor-recorded observations, not executions performed during this review.
  • Merged feature history and routing: Current-main history identifies obviyus through several merged catalog repairs. GitHub verifies refactor(models): compose prepared catalog sources before lookup #143837 as merged at f7a419a; its patch establishes the surrounding composition implementation. It is related predecessor work, not a replacement fixing PR. (src/agents/sessions/model-registry.ts:568, f7a419aeaf72)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-11T02:56:39.453Z sha e965c93 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-11T03:05:28.982Z sha 6895fe0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 11, 2026
@obviyus
obviyus merged commit 872cb0a into main Sep 11, 2026
183 checks passed
@obviyus
obviyus deleted the fix/provider-without-models-startup branch September 11, 2026 03:24
@obviyus

obviyus commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

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.

  • Bug: Valid provider settings without custom model rows could crash Gateway startup when a configured channel was automatically enabled.
  • Fix: Catalog composition accepts omitted custom rows while preserving inherited models and current request settings.
Before After
Gateway exits with a model-list iteration error. Gateway reaches readiness and retains the provider catalog.

Provider-level enabled remains invalid configuration. Synthetic credentials and disabled channel connections limit this proof to startup and catalog behavior.

obviyus added a commit that referenced this pull request Sep 11, 2026
## 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
… (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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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