openclaw - 💡(How to fix) Fix Regression: embedded agent prep takes 50–80s on 2026.4.29 even with only one channel plugin enabled [1 comments, 2 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#76023Fetched 2026-05-03 04:43:12
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
closed ×1commented ×1unsubscribed ×1

After upgrading to 2026.4.29, embedded agent startup/prep became extremely slow. Messages are received by the channel promptly, but the embedded agent does not become stream-ready for roughly 50–80 seconds.

This appears to be in the gateway / embedded agent prep path rather than the Weixin channel itself.

Error Message

2026-05-02T09:26:33.820Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20525 stages=workspace:0ms@0ms,runtime-plugins:1ms@1ms,hooks:1ms@2ms,model-resolution:3545ms@3547ms,auth:7600ms@11147ms,context-engine:0ms@11147ms,attempt-dispatch:9378ms@20525ms 2026-05-02T09:27:51.771Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=77946 stages=workspace-sandbox:9463ms@9463ms,skills:0ms@9463ms,core-plugin-tools:9803ms@19266ms,bootstrap-context:8611ms@27877ms,bundle-tools:5799ms@33676ms,system-prompt:25960ms@59636ms,session-resource-loader:1909ms@61545ms,agent-session:2ms@61547ms,stream-setup:16399ms@77946ms 2026-05-02T09:28:03.548Z warn diagnostic {"subsystem":"diagnostic"} liveness warning: reasons=event_loop_delay,event_loop_utilization,cpu interval=36s eventLoopDelayP99Ms=28336.7 eventLoopDelayMaxMs=28336.7 eventLoopUtilization=1 cpuCoreRatio=1.01 active=1 waiting=0 queued=1 2026-05-02T09:30:43.011Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20210 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3546ms@3548ms,auth:7625ms@11173ms,context-engine:1ms@11174ms,attempt-dispatch:9036ms@20210ms 2026-05-02T09:31:34.824Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=51809 stages=workspace-sandbox:387ms@387ms,skills:0ms@387ms,core-plugin-tools:9807ms@10194ms,bootstrap-context:28ms@10222ms,bundle-tools:5785ms@16007ms,system-prompt:17573ms@33580ms,session-resource-loader:1873ms@35453ms,agent-session:2ms@35455ms,stream-setup:16353ms@51808ms 2026-05-02T09:34:59.076Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=23588 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3590ms@3592ms,auth:7737ms@11329ms,context-engine:0ms@11329ms,attempt-dispatch:12259ms@23588ms 2026-05-02T09:35:51.284Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=52204 stages=workspace-sandbox:5ms@5ms,skills:1ms@6ms,core-plugin-tools:9913ms@9919ms,bootstrap-context:37ms@9956ms,bundle-tools:5885ms@15841ms,system-prompt:17822ms@33663ms,session-resource-loader:1901ms@35564ms,agent-session:3ms@35567ms,stream-setup:16636ms@52203ms

Root Cause

It would also help to have a way to cache or prebuild the expensive core-plugin-tools, bundle-tools, system-prompt, and stream-setup stages for messaging channels, because this delay makes chat channels feel unusable.

Fix Action

Fix / Workaround

2026-05-02T09:26:33.820Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20525 stages=workspace:0ms@0ms,runtime-plugins:1ms@1ms,hooks:1ms@2ms,model-resolution:3545ms@3547ms,auth:7600ms@11147ms,context-engine:0ms@11147ms,attempt-dispatch:9378ms@20525ms
2026-05-02T09:30:43.011Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20210 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3546ms@3548ms,auth:7625ms@11173ms,context-engine:1ms@11174ms,attempt-dispatch:9036ms@20210ms
2026-05-02T09:34:59.076Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=23588 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3590ms@3592ms,auth:7737ms@11329ms,context-engine:0ms@11329ms,attempt-dispatch:12259ms@23588ms

Code Example

2026-05-02T09:25:16.166Z info gateway {"subsystem":"gateway"} http server listening (1 plugin: openclaw-weixin; 4.9s)

---

2026-05-02T09:25:58.916Z info gateway/channels/openclaw-weixin/f2fa6c1a1ff7-im-bot [f2fa6c1a1ff7-im-bot] inbound message: from=... types=1
2026-05-02T09:25:59.165Z info gateway/channels/openclaw-weixin inbound: from=... bodyLen=31 hasMedia=false

---

2026-05-02T09:26:33.820Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20525 stages=workspace:0ms@0ms,runtime-plugins:1ms@1ms,hooks:1ms@2ms,model-resolution:3545ms@3547ms,auth:7600ms@11147ms,context-engine:0ms@11147ms,attempt-dispatch:9378ms@20525ms

---

2026-05-02T09:27:51.771Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=77946 stages=workspace-sandbox:9463ms@9463ms,skills:0ms@9463ms,core-plugin-tools:9803ms@19266ms,bootstrap-context:8611ms@27877ms,bundle-tools:5799ms@33676ms,system-prompt:25960ms@59636ms,session-resource-loader:1909ms@61545ms,agent-session:2ms@61547ms,stream-setup:16399ms@77946ms

---

2026-05-02T09:28:03.548Z warn diagnostic {"subsystem":"diagnostic"} liveness warning: reasons=event_loop_delay,event_loop_utilization,cpu interval=36s eventLoopDelayP99Ms=28336.7 eventLoopDelayMaxMs=28336.7 eventLoopUtilization=1 cpuCoreRatio=1.01 active=1 waiting=0 queued=1

---

2026-05-02T09:30:43.011Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20210 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3546ms@3548ms,auth:7625ms@11173ms,context-engine:1ms@11174ms,attempt-dispatch:9036ms@20210ms

---

2026-05-02T09:31:34.824Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=51809 stages=workspace-sandbox:387ms@387ms,skills:0ms@387ms,core-plugin-tools:9807ms@10194ms,bootstrap-context:28ms@10222ms,bundle-tools:5785ms@16007ms,system-prompt:17573ms@33580ms,session-resource-loader:1873ms@35453ms,agent-session:2ms@35455ms,stream-setup:16353ms@51808ms

---

2026-05-02T09:34:59.076Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=23588 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3590ms@3592ms,auth:7737ms@11329ms,context-engine:0ms@11329ms,attempt-dispatch:12259ms@23588ms

---

2026-05-02T09:35:51.284Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=52204 stages=workspace-sandbox:5ms@5ms,skills:1ms@6ms,core-plugin-tools:9913ms@9919ms,bootstrap-context:37ms@9956ms,bundle-tools:5885ms@15841ms,system-prompt:17822ms@33663ms,session-resource-loader:1901ms@35564ms,agent-session:3ms@35567ms,stream-setup:16636ms@52203ms
RAW_BUFFERClick to expand / collapse

Summary

After upgrading to 2026.4.29, embedded agent startup/prep became extremely slow. Messages are received by the channel promptly, but the embedded agent does not become stream-ready for roughly 50–80 seconds.

This appears to be in the gateway / embedded agent prep path rather than the Weixin channel itself.

Environment

  • OpenClaw version: 2026.4.29
  • OS: Arch Linux
  • Channel used for testing: openclaw-weixin
  • Install method: pnpm global install
  • Gateway mode: local systemd/user gateway

What I tested

To isolate the issue, I progressively disabled other components and tested again:

  • Disabled openclaw-qqbot
  • Disabled browser
  • Disabled memory-core
  • Disabled openclaw-lark
  • Removed extra tool allowlists
  • Switched tool profile from coding to messaging
  • Switched to an empty workspace
  • Left only one plugin enabled: openclaw-weixin

Even in this minimized setup, the delay remained very large.

Expected behavior

After the channel receives a message, the embedded agent should start and become stream-ready quickly, ideally within a few seconds.

Actual behavior

The Weixin channel receives the inbound message quickly, but embedded agent startup/prep takes tens of seconds.

In one minimized run, the gateway was running with only one plugin:

2026-05-02T09:25:16.166Z info gateway {"subsystem":"gateway"} http server listening (1 plugin: openclaw-weixin; 4.9s)

Then the message was received:

2026-05-02T09:25:58.916Z info gateway/channels/openclaw-weixin/f2fa6c1a1ff7-im-bot [f2fa6c1a1ff7-im-bot] inbound message: from=... types=1
2026-05-02T09:25:59.165Z info gateway/channels/openclaw-weixin inbound: from=... bodyLen=31 hasMedia=false

But embedded agent startup still took about 20s:

2026-05-02T09:26:33.820Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20525 stages=workspace:0ms@0ms,runtime-plugins:1ms@1ms,hooks:1ms@2ms,model-resolution:3545ms@3547ms,auth:7600ms@11147ms,context-engine:0ms@11147ms,attempt-dispatch:9378ms@20525ms

And the prep stage took around 78s:

2026-05-02T09:27:51.771Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=06cf5a7d-cc14-4af0-a10d-c8d1d1ecf0c5 sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=77946 stages=workspace-sandbox:9463ms@9463ms,skills:0ms@9463ms,core-plugin-tools:9803ms@19266ms,bootstrap-context:8611ms@27877ms,bundle-tools:5799ms@33676ms,system-prompt:25960ms@59636ms,session-resource-loader:1909ms@61545ms,agent-session:2ms@61547ms,stream-setup:16399ms@77946ms

The gateway also reported heavy event-loop blocking:

2026-05-02T09:28:03.548Z warn diagnostic {"subsystem":"diagnostic"} liveness warning: reasons=event_loop_delay,event_loop_utilization,cpu interval=36s eventLoopDelayP99Ms=28336.7 eventLoopDelayMaxMs=28336.7 eventLoopUtilization=1 cpuCoreRatio=1.01 active=1 waiting=0 queued=1

After switching to an empty workspace, the workspace scan became much faster, but the overall delay was still very high:

2026-05-02T09:30:43.011Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=20210 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3546ms@3548ms,auth:7625ms@11173ms,context-engine:1ms@11174ms,attempt-dispatch:9036ms@20210ms
2026-05-02T09:31:34.824Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=c7565319-d7f5-4de6-bba1-d31b39cd96ef sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=51809 stages=workspace-sandbox:387ms@387ms,skills:0ms@387ms,core-plugin-tools:9807ms@10194ms,bootstrap-context:28ms@10222ms,bundle-tools:5785ms@16007ms,system-prompt:17573ms@33580ms,session-resource-loader:1873ms@35453ms,agent-session:2ms@35455ms,stream-setup:16353ms@51808ms

After switching the profile to messaging and clearing extra tool allowlists, it was still similarly slow:

2026-05-02T09:34:59.076Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] startup stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=attempt-dispatch totalMs=23588 stages=workspace:0ms@0ms,runtime-plugins:2ms@2ms,hooks:0ms@2ms,model-resolution:3590ms@3592ms,auth:7737ms@11329ms,context-engine:0ms@11329ms,attempt-dispatch:12259ms@23588ms
2026-05-02T09:35:51.284Z warn agent/embedded {"subsystem":"agent/embedded"} [trace:embedded-run] prep stages: runId=ef85fcec-6bb3-45c6-89e0-33bf2ac87bbf sessionId=c16878ff-5573-444b-bf31-c359ad785901 phase=stream-ready totalMs=52204 stages=workspace-sandbox:5ms@5ms,skills:1ms@6ms,core-plugin-tools:9913ms@9919ms,bootstrap-context:37ms@9956ms,bundle-tools:5885ms@15841ms,system-prompt:17822ms@33663ms,session-resource-loader:1901ms@35564ms,agent-session:3ms@35567ms,stream-setup:16636ms@52203ms

Key observations

The consistently expensive stages are:

  • core-plugin-tools: about 9–10s
  • bundle-tools: about 5–6s
  • system-prompt: about 17–28s
  • stream-setup: about 16s
  • auth: about 7–8s
  • attempt-dispatch: about 9–12s

This happens even after minimizing plugins and using an empty workspace.

The event-loop diagnostics also show severe blocking, e.g. eventLoopUtilization=1 and eventLoopDelayMaxMs around 28s.

Why this seems like a regression

This setup did not feel this slow before the recent update. On 2026.4.29, every inbound message through Weixin takes an extremely long time before the agent becomes stream-ready, even in a reduced configuration.

What would help

Could you check whether there was a regression in embedded agent prep / system-prompt construction / tool bundling / stream setup in 2026.4.29?

It would also help to have a way to cache or prebuild the expensive core-plugin-tools, bundle-tools, system-prompt, and stream-setup stages for messaging channels, because this delay makes chat channels feel unusable.

extent analysis

TL;DR

The embedded agent startup/prep delay can be mitigated by investigating and optimizing the expensive stages in the agent prep process, such as core-plugin-tools, bundle-tools, system-prompt, and stream-setup.

Guidance

  • Investigate the recent changes in 2026.4.29 that may have introduced a regression in the embedded agent prep process, focusing on the expensive stages identified.
  • Consider implementing caching or prebuilding for the expensive stages, such as core-plugin-tools, bundle-tools, system-prompt, and stream-setup, to reduce the delay.
  • Review the event-loop diagnostics to understand the cause of the severe blocking and high eventLoopUtilization.
  • Test the embedded agent with different configurations and workloads to identify potential bottlenecks and areas for optimization.

Example

No specific code snippet can be provided without more information on the implementation details of the embedded agent and the expensive stages. However, a potential optimization could involve caching the results of the core-plugin-tools stage to avoid redundant computations.

Notes

The issue seems to be related to the recent update to 2026.4.29, and the expensive stages identified are consistent across different tests. However, without more information on the implementation details, it is difficult to provide a more specific solution.

Recommendation

Apply a workaround by investigating and optimizing the expensive stages in the agent prep process, and consider implementing caching or prebuilding to reduce the delay. This approach is recommended because it addresses the root cause of the issue and can provide a significant improvement in performance.

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…

FAQ

Expected behavior

After the channel receives a message, the embedded agent should start and become stream-ready quickly, ideally within a few seconds.

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 Regression: embedded agent prep takes 50–80s on 2026.4.29 even with only one channel plugin enabled [1 comments, 2 participants]