You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: model-resolution and auth stages take 11-14s and 8-10s respectively on every agent dispatch (even with 0 plugins, 1 model) #77649
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open: current main still has the reported hot-path surfaces, the issue is fresh with concrete timing data, and I did not find a merged current-main or shipped-release fix for the model-resolution/auth latency or the Windows event-loop stall.
Reproducibility: no. The stage names and slow thresholds are source-backed on current main, but I did not establish a high-confidence Windows current-main reproduction from only openclaw gateway restart and the provided measurements.
Next step
The report is severe and recent, but it needs maintainer-guided Windows profiling or clearer logs before an autonomous repair PR has a narrow enough root cause.
Review details
Best possible solution:
Profile the Windows dispatch path with startup-stage logs enabled, then remove repeated synchronous model/auth/catalog work from the hot path while preserving cached default health/status behavior.
Do we have a high-confidence way to reproduce the issue?
No. The stage names and slow thresholds are source-backed on current main, but I did not establish a high-confidence Windows current-main reproduction from only openclaw gateway restart and the provided measurements.
Is this the best way to solve the issue?
Unclear. There is no proposed patch; the likely maintainable direction is a targeted performance fix in embedded model/auth resolution plus verification that default health/status remain cached and fast.
Acceptance criteria:
Windows 10 live reproduction with OPENCLAW_GATEWAY_STARTUP_TRACE=1 and embedded-run stage warnings captured
Targeted tests around src/agents/pi-embedded-runner/run.ts, src/agents/pi-embedded-runner/model.ts, and src/gateway/server-methods/health.ts once a root cause is isolated
Run the changed gate appropriate to touched agent/gateway files after any fix
What I checked:
Reporter timing data: The issue reports Windows 10 with OpenClaw 2026.5.3-1, model-resolution at 11852-14091ms, auth at 7779-10882ms, health at 10.5s, status at 24s, one CPU-saturated thread, and eventLoopDelayMaxMs up to 45s.
Embedded run stage source: Current main records the same model-resolution and auth startup stages around dynamic model resolution, optional models.json generation, auth-store/profile ordering, and initializeAuthProfile. (src/agents/pi-embedded-runner/run.ts:496, a373468d8252)
Health cache and probe behavior: The gateway health method can return a fresh cached snapshot for non-probe requests, but explicit probe requests force refreshHealthSnapshot; this keeps slow live health probes relevant rather than obsolete. (src/gateway/server-methods/health.ts:85, a373468d8252)
CLI docs contract: Docs say default health can use a cached snapshot and default status stays on the fast read-only path, so 10s health and 24s status are not expected behavior. Public docs: docs/cli/status.md. (docs/cli/status.md:10, a373468d8252)
DeepSeek static provider surface: DeepSeek is a bundled provider plugin with a static model catalog and DEEPSEEK_API_KEY auth, so this should not need broad provider discovery for the named model. (extensions/deepseek/openclaw.plugin.json:22, a373468d8252)
Likely related people:
steipete: Recent current-main commits touch the pi embedded runner dispatch path after the latest release. (role: recent maintainer; confidence: medium; commits: 7168896fdfed, 5dfaed184608, ed4b223cf252; files: src/agents/pi-embedded-runner/run.ts)
Eduardo Piva: Recent work wired and validated post-compaction guard behavior in the same embedded-runner dispatch area shortly before this report. (role: adjacent owner; confidence: medium; commits: 2a702f927fb5, 4c4825679b69; files: src/agents/pi-embedded-runner/run.ts)
Vincent Koc: Local history for the health/status and auth/model files resolves through the current release-refresh commit in this checkout; routing confidence is lower because deeper blame history was unavailable locally. (role: current-file history owner; confidence: low; commits: a491090b4867; files: src/gateway/server-methods/health.ts, src/commands/health.ts, src/commands/status-runtime-shared.ts)
Remaining risk / open question:
No Windows 10 live reproduction was run, so the exact source of the CPU-bound stall is not isolated.
The issue gives strong measurements but minimal reproduction steps and no redacted logs or config, especially for the claimed 0-plugin setup while DeepSeek is a bundled provider plugin.
Codex review notes: model gpt-5.5, reasoning high; reviewed against a373468d8252.
Closing this out based on a follow-up local repro/audit.
I reproduced the gateway/control-plane symptom on macOS against the reported release (openclaw@2026.5.3-1, 2eae30e): external /healthz and /readyz took about 29.5s even though the gateway logged itself ready much earlier. The macOS repro did not reproduce the exact slow model-resolution / auth stage numbers with OpenRouter, but it did reproduce the important infra failure mode: synchronous provider discovery/plugin loading can starve the event loop after readiness, so health/status/websocket control traffic is not serviced reliably.
Current 5.4 behavior is materially improved in the same local harness: health/ready were about 1.8-2.1s and embedded startup stages were sub-second (model-resolution hundreds of ms, auth about 100ms). The likely relevant fixes after 2eae30e are the native plugin-load path changes, especially avoiding JIT/source-loader work for compiled plugin modules and duplicate fallback loads.
One nuance: broad model/provider discovery is still legitimate for explicit catalog/setup flows like /models --all, onboarding, doctor/status, and self-hosted provider scans. So the follow-up hardening should be scoped to keeping agent-run startup and gateway control-plane readiness responsive, not globally disabling broad discovery.
Given this appears fixed or substantially mitigated after the reported release, I am closing this issue. If the same 20s+ dispatch/control-plane stall reproduces on current main or a newer release with startup trace logs, please reopen or file a fresh issue with the redacted trace.
Gateway startup: listening in about 2.6s, ready in about 4.3s
openclaw health --timeout 2500 --json warm runs:
wall: 3.21s, 2.86s, 2.95s
gateway durationMs: 245ms, 247ms, 233ms
openclaw status --timeout 2500 --json warm runs:
wall: 4.45s, 4.24s, 4.24s
Local DeepSeek agent startup with synthetic API key:
startup total to attempt-dispatch: 3473ms
runtime-plugins: 882ms
model-resolution: 526ms
auth: 2060ms
attempt-dispatch: 3ms
provider call then failed as expected with 401 after 827ms
Not reproduced on latest beta in this run: the original health ~10.5s, status ~24s, model-resolution 11-14s, or auth 7-10s timings.
One related observation: shortly after gateway startup, there was a transient liveness warning with eventLoopDelayMaxMs=2183.1; recent phases included sidecars.session-locks:2202ms and sidecars.model-prewarm:4002ms. That is still far below the reported eventLoopDelayMaxMs up to ~45s.
Caveat: I did not pass a real DeepSeek key into the Windows VM command line, so the agent measurement covers startup/model/auth stages and expected invalid-key failure, not successful live DeepSeek dispatch latency.
Activity
clawsweeper commentedon May 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open: current main still has the reported hot-path surfaces, the issue is fresh with concrete timing data, and I did not find a merged current-main or shipped-release fix for the model-resolution/auth latency or the Windows event-loop stall.
Reproducibility: no. The stage names and slow thresholds are source-backed on current main, but I did not establish a high-confidence Windows current-main reproduction from only
openclaw gateway restartand the provided measurements.Next step
The report is severe and recent, but it needs maintainer-guided Windows profiling or clearer logs before an autonomous repair PR has a narrow enough root cause.
Review details
Best possible solution:
Profile the Windows dispatch path with startup-stage logs enabled, then remove repeated synchronous model/auth/catalog work from the hot path while preserving cached default health/status behavior.
Do we have a high-confidence way to reproduce the issue?
No. The stage names and slow thresholds are source-backed on current main, but I did not establish a high-confidence Windows current-main reproduction from only
openclaw gateway restartand the provided measurements.Is this the best way to solve the issue?
Unclear. There is no proposed patch; the likely maintainable direction is a targeted performance fix in embedded model/auth resolution plus verification that default health/status remain cached and fast.
Acceptance criteria:
OPENCLAW_GATEWAY_STARTUP_TRACE=1and embedded-run stage warnings capturedsrc/agents/pi-embedded-runner/run.ts,src/agents/pi-embedded-runner/model.ts, andsrc/gateway/server-methods/health.tsonce a root cause is isolatedWhat I checked:
src/agents/pi-embedded-runner/run.ts:496, a373468d8252)src/agents/pi-embedded-runner/run/attempt-stage-timing.ts:17, a373468d8252)src/gateway/server-methods/health.ts:85, a373468d8252)docs/cli/status.md. (docs/cli/status.md:10, a373468d8252)extensions/deepseek/openclaw.plugin.json:22, a373468d8252)Likely related people:
src/agents/pi-embedded-runner/run.ts)src/agents/pi-embedded-runner/run.ts)src/gateway/server-methods/health.ts,src/commands/health.ts,src/commands/status-runtime-shared.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a373468d8252.
scoootscooob commentedon May 5, 2026
Closing this out based on a follow-up local repro/audit.
I reproduced the gateway/control-plane symptom on macOS against the reported release (
openclaw@2026.5.3-1,2eae30e): external/healthzand/readyztook about 29.5s even though the gateway logged itself ready much earlier. The macOS repro did not reproduce the exact slowmodel-resolution/authstage numbers with OpenRouter, but it did reproduce the important infra failure mode: synchronous provider discovery/plugin loading can starve the event loop after readiness, so health/status/websocket control traffic is not serviced reliably.Current 5.4 behavior is materially improved in the same local harness: health/ready were about 1.8-2.1s and embedded startup stages were sub-second (
model-resolutionhundreds of ms,authabout 100ms). The likely relevant fixes after2eae30eare the native plugin-load path changes, especially avoiding JIT/source-loader work for compiled plugin modules and duplicate fallback loads.One nuance: broad model/provider discovery is still legitimate for explicit catalog/setup flows like
/models --all, onboarding, doctor/status, and self-hosted provider scans. So the follow-up hardening should be scoped to keeping agent-run startup and gateway control-plane readiness responsive, not globally disabling broad discovery.Given this appears fixed or substantially mitigated after the reported release, I am closing this issue. If the same 20s+ dispatch/control-plane stall reproduces on current main or a newer release with startup trace logs, please reopen or file a fresh issue with the redacted trace.
steipete commentedon May 5, 2026
Measured current beta on a Windows box.
Environment:
Windows 11guest (Microsoft Windows NT 10.0.26100)v24.14.011.9.0openclaw@beta->2026.5.4-beta.2 (e0002c4)OPENCLAW_HOME/OPENCLAW_STATE_DIR; gateway on isolated port19776Measured:
npm install --prefix <temp> openclaw@beta --no-audit --no-fund:24.0s2.6s, ready in about4.3sopenclaw health --timeout 2500 --jsonwarm runs:3.21s,2.86s,2.95sdurationMs:245ms,247ms,233msopenclaw status --timeout 2500 --jsonwarm runs:4.45s,4.24s,4.24sattempt-dispatch:3473msruntime-plugins:882msmodel-resolution:526msauth:2060msattempt-dispatch:3ms401after827msNot reproduced on latest beta in this run: the original
health ~10.5s,status ~24s,model-resolution 11-14s, orauth 7-10stimings.One related observation: shortly after gateway startup, there was a transient liveness warning with
eventLoopDelayMaxMs=2183.1; recent phases includedsidecars.session-locks:2202msandsidecars.model-prewarm:4002ms. That is still far below the reportedeventLoopDelayMaxMsup to ~45s.Caveat: I did not pass a real DeepSeek key into the Windows VM command line, so the agent measurement covers startup/model/auth stages and expected invalid-key failure, not successful live DeepSeek dispatch latency.