Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Discord channel input shows typing for ~30s before model starts.
Steps to reproduce
- Start OpenClaw with moonshot without "openai-compatible" endpoint config.
- Talk to OepnClaw on Discord.
Expected behavior
Show typing indicator in few seconds.
Actual behavior
Show typing indicator after 10~30s
OpenClaw version
2026.5.19 (also reproduced on 2026.5.18)
Operating system
Ubuntu 24.04 / linux 6.8.0-117-generic x64
Install method
npm global
Model
moonshot/kimi-k2.6 native Moonshot provider
Provider / routing chain
openclaw -> moonshot
Additional provider/model setup details
No response
Logs, screenshots, and evidence
actual log
{"0":"{\"subsystem\":\"agent/embedded\"}","1":"[trace:embedded-run] startup stages: runId=10fe5fe6-d988-4cca-ae7b-27b393dbd594 sessionId=7761c6fb-1c9e-4d9e-bf01-eb26e55cc079 phase=attempt-dispatch totalMs=33703 stages=workspace:0ms@0ms,runtime-plugins:17ms@17ms,hooks:0ms@17ms,model-resolution:33681ms@33698ms,auth:1ms@33699ms,context-engine:1ms@33700ms,attempt-workspace:2ms@33702ms,attempt-prompt:0ms@33702ms,attempt-runtime-plan:1ms@33703ms,attempt-dispatch:0ms@33703ms","_meta":{"runtime":"node","runtimeVersion":"24.15.0","hostname":"unknown","name":"{\"subsystem\":\"agent/embedded\"}","parentNames":["openclaw"],"date":"2026-05-21T03:01:30.073Z","logLevelId":4,"logLevelName":"WARN","path":{"fullFilePath":"file:///home/openclaw/.npm-global/lib/node_modules/openclaw/dist/subsystem-C-H8Q21Y.js:178:14","fileName":"subsystem-C-H8Q21Y.js","fileNameWithLine":"subsystem-C-H8Q21Y.js:178","fileColumn":"14","fileLine":"178","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-C-H8Q21Y.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-C-H8Q21Y.js:178","method":"logToFile"}},"time":"2026-05-21T12:01:30.073+09:00","hostname":"microserver","message":"[trace:embedded-run] startup stages: runId=10fe5fe6-d988-4cca-ae7b-27b393dbd594 sessionId=7761c6fb-1c9e-4d9e-bf01-eb26e55cc079 phase=attempt-dispatch totalMs=33703 stages=workspace:0ms@0ms,runtime-plugins:17ms@17ms,hooks:0ms@17ms,model-resolution:33681ms@33698ms,auth:1ms@33699ms,context-engine:1ms@33700ms,attempt-workspace:2ms@33702ms,attempt-prompt:0ms@33702ms,attempt-runtime-plan:1ms@33703ms,attempt-dispatch:0ms@33703ms"}
---
openclaw@microserver:~$ openclaw models status
🦞 OpenClaw 2026.5.19 (a185ca2) — One CLI to rule them all, and one more restart because you changed the port.
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : moonshot/kimi-k2.6
Fallbacks (4) : google/gemini-3.1-pro-preview, google/gemini-flash-latest, google/gemini-flash-lite-latest, openai/gpt-5.3-codex
Image model : -
Image fallbacks (0): -
Aliases (3) : gemini -> google/gemini-3.1-pro-preview, Kimi -> moonshot/kimi-k2.6, GPT -> openai/gpt-5.3-codex
Configured models (5): google/gemini-3.1-pro-preview, google/gemini-flash-latest, google/gemini-flash-lite-latest, moonshot/kimi-k2.6, openai/gpt-5.3-codex
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : on
Providers w/ OAuth/tokens (0): -
- elevenlabs effective=env:[REDACTED] | env=[REDACTED] | source=env: ELEVENLABS_API_KEY
- google effective=env:[REDACTED] | env=[REDACTED] | source=env: GEMINI_API_KEY
- moonshot effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | moonshot:default=[REDACTED] | env=[REDACTED] | source=env: MOONSHOT_API_KEY
- openai effective=env:[REDACTED] | env=[REDACTED] | source=env: OPENAI_API_KEY
- openai-codex effective=synthetic:codex-app-server | synthetic=plugin-owned | source=codex-app-server
Runtime auth
- openai via codex uses openai-codex effective=synthetic:codex-app-server | status=usable
OAuth/token status
- none
openclaw@microserver:~$ openclaw status --all
🦞 OpenClaw 2026.5.19 (a185ca2) — I'm not saying your workflow is chaotic... I'm just bringing a linter and a helmet.
│
12:19:00 [plugins] [memory-lancedb-pro] memory_recall queries the plugin store (LanceDB), not MEMORY.md.
- Plugin memory (LanceDB) = primary recall source for semantic search
- MEMORY.md / memory/YYYY-MM-DD.md = startup context / journal only
- Use memory_store or auto-capture for recallable memories.
OpenClaw status --all
Overview
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Item │ Value │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Version │ 2026.5.19 │
│ OS │ linux 6.8.0-117-generic (x64) │
│ Node │ 24.15.0 │
│ Config │ ~/.openclaw/openclaw.json │
│ Dashboard │ http://127.0.0.1:18789/ │
│ Tailscale exposure │ serve · unknown · microserver.taildc77f.ts.net · https://microserver.taildc77f.ts.net │
│ Channel │ stable (default) │
│ Update │ pnpm · up to date · npm latest 2026.5.19 │
│ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · reachable 205ms · auth token · microserver (192.168.11.4) app 2026.5.19 linux │
│ │ 6.8.0-117-generic │
│ Security │ Run: openclaw security audit --deep │
│ Gateway self │ unknown │
│ Gateway service │ systemd user installed · enabled · running (pid 42034, state active) │
│ Node service │ systemd user not installed │
│ Agents │ 3 total · 0 bootstrapping · 0 active · 6 sessions │
│ Secrets │ none │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Channels
┌──────────┬─────────┬────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Channel │ Enabled │ State │ Detail │
├──────────┼─────────┼────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Discord │ ON │ OK │ token config (sha256:488d4a30 · len 72) · accounts 1/1 │
└──────────┴─────────┴────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Discord accounts
┌──────────┬──────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Account │ Status │ Notes │
├──────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ default │ OK │ token:config · credential available in gateway runtime │
└──────────┴──────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Agents
┌─────────────────┬────────────────┬──────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────────┐
│ Agent │ Bootstrap file │ Sessions │ Active │ Store │
├─────────────────┼────────────────┼──────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ main │ ABSENT │ 5 │ 17m ago │ ~/.openclaw/agents/main/sessions/sessions.json │
│ auto-researcher │ ABSENT │ 0 │ unknown │ ~/.openclaw/agents/auto-researcher/sessions/sessions.json │
│ public │ ABSENT │ 1 │ 10d ago │ ~/.openclaw/agents/public/sessions/sessions.json │
└─────────────────┴────────────────┴──────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────────┘
Diagnosis (read-only)
Gateway connection details:
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/openclaw/.openclaw/openclaw.json
Bind: loopback
✓ Config: /home/openclaw/.openclaw/openclaw.json
✓ Secret diagnostics (0)
✓ Restart sentinel: none
✓ Port 18789
Detected OpenClaw Gateway listener on the configured port.
! Tailscale exposure: serve · daemon unknown · microserver.taildc77f.ts.net
https: https://microserver.taildc77f.ts.net
✓ Skills: 24 eligible · 0 missing · /home/openclaw/.openclaw/workspace
✓ Plugin compatibility (none)
Gateway restart attempts (tail): /home/openclaw/.openclaw/logs/gateway-restart.log
[2026-05-20T16:06:48Z] openclaw restart attempt source=update target=openclaw-gateway.service
[2026-05-20T16:06:48Z] openclaw restart done source=update
[2026-05-21T02:12:41Z] openclaw restart attempt source=update target=openclaw-gateway.service
[2026-05-21T02:12:45Z] openclaw restart done source=update
✓ Channel issues (none)
Pasteable debug report. Auth tokens redacted.
Troubleshooting: https://docs.openclaw.ai/troubleshooting
◇
openclaw@microserver:~$ openclaw config get agents.defaults.model
🦞 OpenClaw 2026.5.19 (a185ca2) — I'm not magic—I'm just extremely persistent with retries and coping strategies.
{
"primary": "moonshot/kimi-k2.6",
"fallbacks": [
"google/gemini-3.1-pro-preview",
"google/gemini-flash-latest",
"google/gemini-flash-lite-latest",
"openai/gpt-5.3-codex"
]
}
openclaw@microserver:~$ openclaw config get models.providers.moonshot
🦞 OpenClaw 2026.5.19 (a185ca2) — Greetings, Professor Falken
Config path not found: models.providers.moonshot. Run openclaw config validate to inspect config shape.Impact and severity
No response
Additional information
No response
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 21, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 30, 2026, 10:00 PM ET / 02:00 UTC.
Summary
Keep this open: current main still leaves native OpenClaw provider runs on the broad discovery path after the lean dynamic pass misses, while the merged static-catalog fix only covers plugin-harness transport. The issue has concrete reporter logs, a second native-provider reproduction, and the direct native fast-path PRs are closed unmerged.
Reproducibility: yes. at source level: current main still sends native providers through broad discovery after the lean dynamic pass misses. No live Moonshot or Google Discord/TUI repro was run in this read-only review.
Next step
Prior fix attempts show the code shape is clear, but provider precedence and live dispatch proof require maintainer review before another autonomous fix PR.
Review details
Best possible solution:
Land a maintainer-approved provider-agnostic native-provider fast path that avoids broad discovery for exact static-catalog model refs without bypassing provider-owned auth/runtime metadata, with redacted before/after dispatch timing proof.
Do we have a high-confidence way to reproduce the issue?
Yes at source level: current main still sends native providers through broad discovery after the lean dynamic pass misses. No live Moonshot or Google Discord/TUI repro was run in this read-only review.
Is this the best way to solve the issue?
Unclear as an implementation: a provider-agnostic fast path is needed, but prior repair review showed static-catalog precedence can change provider/auth routing unless maintainers accept or gate it.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against d9aedc32a131.
Label changes
Label changes:
clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.Label justifications:
P1: The issue reports real first-turn native-provider dispatch delays of 10-75 seconds before the model starts.impact:auth-provider: The affected surface is provider/model resolution and routing before embedded agent dispatch.Evidence reviewed
Acceptance criteria:
What I checked:
AGENTS.md:99, 7ceaf0ece350)src/agents/embedded-agent-runner/run.ts:1091, d9aedc32a131)src/agents/embedded-agent-runner/model.ts:1718, d9aedc32a131)src/agents/embedded-agent-runner/model.test.ts:585, d9aedc32a131)src/agents/embedded-agent-runner.e2e.test.ts:705, d9aedc32a131)src/agents/embedded-agent-runner/run.ts:1088, e085fa1a3ffd)Likely related people:
src/agents/embedded-agent-runner/run.ts,src/agents/embedded-agent-runner/model.ts)src/agents/embedded-agent-runner/run.ts,src/agents/embedded-agent-runner/model.ts,src/agents/embedded-agent-runner.e2e.test.ts)src/plugins/active-runtime-registry.ts,src/plugins/provider-hook-runtime.ts,src/agents/runtime-plugins.test.ts)src/agents/embedded-agent-runner/run.ts,src/agents/embedded-agent-runner/model.ts,extensions/moonshot/index.ts)src/agents/embedded-agent-runner/run.ts,src/agents/embedded-agent-runner/model.ts,extensions/codex/src/app-server/thread-lifecycle.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.resYuto commentedon May 21, 2026
In TUI mode, same issue appeared. So I think it happen in not just Discord.
when new session started, log said took 5secs, but actually I waited ~30secs.
resYuto commentedon May 21, 2026
Workaround found
I investigated this with Codex and found the root cause in the model-resolution path.
What's happening
The PI runner first tries
skipPiDiscovery: truewith the plugin's dynamic model hook (resolveDynamicModel). The Moonshot plugin doesn't implement this hook, so it fails. Then it falls back toensureOpenClawModelsJson()→ModelRegistry.find()usingagentDir/models.json, which is slow and causes the 10–30s delay.How I fixed it
I rewrote my OpenClaw config to include explicit model data with
apiandbaseUrlviaopenclaw config. This allows the model to resolve as an inline model duringskipPiDiscovery, skipping the slow fallback entirely.Before (slow fallback path)
// no resolution data
After (fast inline resolution)
Response time dropped from ~30s to under 2s.
Suggested fix
Implement
resolveDynamicModelin the Moonshot plugin so native provider users don't need this workaround. Alternatively, shorten the fallback timeout or warn when a provider lacks dynamic resolution.gedefet commentedon Jun 22, 2026
Reproduces with a second native provider (Google / Gemini), not just Moonshot — and on Windows the broad-discovery path is dramatically slower. Adding a CPU profile that pinpoints what broad discovery actually spends the time on, in case it's useful for shaping the fast-path fix.
Environment
plugins.entries.google.enabled = true), primarygoogle/gemini-2.5-flash.modelsentries are empty ({}), i.e. no explicitmodels.providers.googlemetadata — same precondition as the Moonshot workaround.Symptom (embedded-run
startup stagestrace)model-resolutiondominates every cold start, silently:Warm turns in the same session are ~6–8s. So this is purely the first-turn resolution cost, matching this issue.
What broad discovery is actually doing (CPU profile)
Captured with
node --cpu-profover one cold start (model-resolution = 48.9s that run). Top self-time:It's almost entirely ESM module-loader filesystem stat thrashing while loading the provider plugins during broad discovery — not network, not auth. Confirmed by isolation:
:443connection appears at generation time at the very end.Why it's so much worse here (Windows)
The openclaw install is 31,209 files;
statthroughput on this machine is ~0.27ms/file cold, ~0.12ms/file warm (vs ~0.01ms on a fast SSD without real-time AV). Broad discovery re-stats candidate paths hundreds of thousands of times → tens of seconds. Windows Defender real-time protection (on) amplifies everylstat/open. So the same broad-discovery path that costs ~33s for the reporter is 40–75s on Windows.Takeaways
plugin-module-loader-cacheappears to re-resolve/re-stat the plugin tree on every cold start). Even when discovery is unavoidable, caching those module resolutions across cold starts would help a lot, especially on Windows. Happy to open that as a separate perf issue if you'd prefer to keep this one scoped to the fast-path gate.I can share the raw
.cpuprofileor run before/after timings against a proposed fast-path PR.openclaw-barnacle commentedon Jul 15, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 22, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.