-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: models.mode="replace" still triggers implicit provider discovery and causes large startup delays #66957
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
With
models.mode="replace"and only one explicit provider configured, OpenClaw still invokes implicit provider discovery before mode-specific handling, contrary to the documented semantics, and minimal legacy embedded-agent startup is delayed by roughly 72 seconds on 2026.4.14.Steps to reproduce
a14f7c5c6d) or currentmain.models.mode="replace"with a minimal explicit provider set.src/config/schema.help.ts:739-740with the implementation insrc/agents/models-config.plan.ts:47-58.resolveProvidersForModelsJsonWithDeps(...)still callsresolveImplicitProviders(...)before any mode-specific handling.Expected behavior
When
models.mode="replace"is configured, OpenClaw should use only explicitly configured providers, should not run implicit provider discovery, and should start legacy embedded-agent execution promptly under a minimal explicit-provider setup.Actual behavior
OpenClaw still appears to invoke implicit provider discovery in
replacemode. In observed runs on 2026.4.14, meaningful lifecycle start was delayed by about 72 seconds before the embedded agent run proceeded.OpenClaw version
2026.4.14 (a14f7c5)
Operating system
Ubuntu 24.04
Install method
source checkout / pnpm tsx
Model
mock-openai/gpt-5.2 (deterministic local test mock)
Provider / routing chain
OpenClaw -> single explicit OpenAI-responses-compatible mock provider
Additional provider/model setup details
The tested setup uses
models.mode="replace"with a single explicit OpenAI-responses-compatible provider to keep provider behavior deterministic. This report concerns provider-planning semantics rather than any specific upstream model capability.Logs, screenshots, and evidence
[debug +0ms] mode=no-abort timeoutMs=20000 rootDir=/home/wzs_ubuntu/projects/agent-policy-fuzz/.tmp/openclaw-core-debug-allowed-timeout/run-2026-04-15T02-15-03-459Z-seed-1337 [event +72868ms] lifecycle {"phase":"start","startedAt":1776219376327} 10:16:36 [agent/embedded] embedded run timeout: runId=debug-allowed-timeout-no-abort sessionId=abc6e832-e415-4a4a-b292-485b27ff0d71 timeoutMs=20000 10:16:36 [agent/embedded] embedded run failover decision: runId=debug-allowed-timeout-no-abort stage=assistant decision=surface_error reason=timeout from=mock-openai/gpt-5.2 profile=- [event +92877ms] lifecycle {"phase":"end","startedAt":1776219353263,"endedAt":1776219396336,"aborted":true} [runtime +92903ms] Request timed out before a response was generated. Please try again, or increase `agents.defaults.timeoutSeconds` in your config.Impact and severity
Affected: users or operators relying on
models.mode="replace"with minimal explicit provider configurationsSeverity: Medium for correctness/reliability; not a confirmed security issue
Frequency: reproduced on 2026.3.22 and again on 2026.4.14
Consequence: documented config semantics are violated, startup becomes severely delayed, and legacy embedded-agent execution becomes much less reliable under minimal explicit-provider setups
Additional information
I first observed this on OpenClaw 2026.3.22 and rechecked it on 2026.4.14 (
a14f7c5c6d), where it still appears present. A local workaround is to short-circuit implicit discovery whencfg.models.mode === "replace"and return only explicit providers in that branch.