openclaw - 💡(How to fix) Fix prewarmConfiguredPrimaryModel blocks 30s on startup (openai-codex provider name mismatch) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73805Fetched 2026-04-29 06:14:54
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2

Root Cause

The sync path in resolveModel (called with skipProviderRuntimeHooks: true) looks up the provider by the name in config (e.g., openai-codex). If the models registry lists models under a different provider key (e.g., codex — 3 models), the sync path finds 0 models and falls through to resolveModelAsync.

The async path runs prepareProviderDynamicModel hooks on all provider plugins. At least one hook makes a network call that times out at exactly 30 seconds, blocking startup.

Fix Action

Workaround

Patching the dist file (server.impl-*.js) to add return; as the first line of prewarmConfiguredPrimaryModel eliminates the 30s delay. This patch is lost on every npm install -g openclaw upgrade.

RAW_BUFFERClick to expand / collapse

Bug Description

prewarmConfiguredPrimaryModel blocks gateway startup for exactly 30 seconds when the configured primary model uses a provider name that doesn't match the models registry.

Root Cause

The sync path in resolveModel (called with skipProviderRuntimeHooks: true) looks up the provider by the name in config (e.g., openai-codex). If the models registry lists models under a different provider key (e.g., codex — 3 models), the sync path finds 0 models and falls through to resolveModelAsync.

The async path runs prepareProviderDynamicModel hooks on all provider plugins. At least one hook makes a network call that times out at exactly 30 seconds, blocking startup.

Steps to Reproduce

  1. Configure agents.defaults.model.primary to use a model like openai-codex/gpt-5.5
  2. The internal models registry lists gpt-5.5 under the codex provider (3 models), not openai-codex (0 models)
  3. Start/restart the gateway
  4. Observe a 30-second gap between "starting gateway" and "ready" in logs
  5. The gap is entirely inside prewarmConfiguredPrimaryModel

Expected Behavior

Provider name resolution should canonicalize openai-codexcodex (or vice versa) before the registry lookup, so the sync path succeeds and no async fallback is needed.

Actual Behavior

Sync resolution fails (0 models for openai-codex), async fallback runs all provider hooks including network calls, one times out at 30s, blocking startup.

Workaround

Patching the dist file (server.impl-*.js) to add return; as the first line of prewarmConfiguredPrimaryModel eliminates the 30s delay. This patch is lost on every npm install -g openclaw upgrade.

Environment

  • OpenClaw v2026.4.26
  • macOS Sequoia 15.x, Mac Mini M4 Pro
  • Primary model: openai-codex/gpt-5.5 (Codex OAuth)

Related Issues

  • #62364 — Slow startup with multiple providers (symptom overlap, different root cause)
  • #32892 — models auth login --provider openai-codex fails with "No provider plugins found" (confirms the 0-models state)
  • #19124 — Unknown provider 'openai-codex' (same provider name confusion)

Suggestion

Either:

  1. Canonicalize provider aliases in resolveModel before the registry lookup, or
  2. Skip the async fallback in prewarmConfiguredPrimaryModel (prewarm failure should not block startup — it's an optimization, not a requirement), or
  3. Add a timeout cap to the prewarm function (e.g., 3s instead of 30s)

The 4.27 changelog mentions "reuse current plugin metadata snapshot for provider discovery" which may address this indirectly.

extent analysis

TL;DR

The most likely fix is to canonicalize provider aliases in resolveModel before the registry lookup to prevent the 30-second delay caused by the async fallback in prewarmConfiguredPrimaryModel.

Guidance

  • Verify that the models registry lists models under a different provider key (e.g., codex instead of openai-codex) to confirm the root cause.
  • Consider patching the resolveModel function to canonicalize provider aliases (e.g., openai-codexcodex) before the registry lookup.
  • As a temporary workaround, patching the prewarmConfiguredPrimaryModel function to skip the async fallback or add a timeout cap (e.g., 3s) can prevent the 30-second delay.
  • Monitor the OpenClaw changelog for updates, as the 4.27 changelog mentions a potential fix for this issue.

Example

No code snippet is provided, as the issue does not include sufficient code context.

Notes

The suggested fix assumes that the provider alias canonicalization is the root cause of the issue. However, without further information or code context, it is difficult to provide a definitive solution.

Recommendation

Apply a workaround by patching the prewarmConfiguredPrimaryModel function to skip the async fallback or add a timeout cap, as this is a more immediate solution that can prevent the 30-second delay.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix prewarmConfiguredPrimaryModel blocks 30s on startup (openai-codex provider name mismatch) [1 participants]