Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
Hello, I am experiencing severe performance degradation and freezing issues with the Openclaw gateway. The main Node.js thread frequently blocks for up to 4 seconds, which causes connected channels (e.g., Telegram) to timeout, resulting in infinite pending states and duplicated message sends.
Steps to reproduce
Error Logs:
The logs show massive event loop delays:
[diagnostic] liveness warning: reasons=event_loop_delay interval=30s eventLoopDelayMaxMs=3936.4 eventLoopUtilization=0.341
Root Cause Analysis:
Upon inspecting the compiled source code, I found that the gateway heavily relies on synchronous operations on the main thread:
- Keychain Access Blocking: The most critical issue is the use of execSync for macOS keychain access (security find-generic-password) in store-DL6VwwSr.js. This operation is notoriously slow and completely halts the event loop until it returns.
- Synchronous File Reading: Numerous instances of fs.readFileSync (e.g., parsing DeviceAuthStoreSchema, checking credentials, storage metadata) instead of asynchronous fs.promises.readFile.
Expected behavior
Expected Behavior:
Could you please refactor these critical path operations to be asynchronous (exec / spawn / fs.promises)? The current synchronous architecture makes it impossible to use heavier models or maintain stable WebSocket/Telegram connections without the gateway completely stalling.
Thank you!
Actual behavior
Expected Behavior:
Could you please refactor these critical path operations to be asynchronous (exec / spawn / fs.promises)? The current synchronous architecture makes it impossible to use heavier models or maintain stable WebSocket/Telegram connections without the gateway completely stalling.
Thank you!
OpenClaw version
2026.5.6
Operating system
macOS
Install method
npm global
Model
Gemini 3.1 pro preview
Provider / routing chain
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 7, 2026
Codex review: this still needs some work.
Summary
Keep this issue open because an open repair explicitly references it for closure, and current evidence does not establish that the reported freezes are fixed.
Reproducibility: no. high-confidence current-main reproduction is established: historical logs show stalls, but current caller guards and worker-backed storage prevent attributing them to the cited operations without a timing trace.
Next step
Establish the blocking operation and measured Gateway responsiveness through the existing linked repair before claiming this issue is resolved.
Review details
Best possible solution:
Remove measured blocking work at its owning production boundary while preserving credential selection and channel responsiveness.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction is established: historical logs show stalls, but current caller guards and worker-backed storage prevent attributing them to the cited operations without a timing trace.
Is this the best way to solve the issue?
A measured repair of the blocking production path is appropriate; replacing synchronous operations wholesale would change unrelated behavior without establishing which operation causes these freezes.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against c3b63ff4c0ec.
Label changes
Label changes:
No label changes.
Label justifications:
P1: Reported multi-second Gateway freezes disrupt active channel and agent workflows on official releases.impact:crash-loop: Repeated event-loop stalls make the Gateway temporarily unresponsive.impact:message-loss: The report describes channel timeouts, indefinitely pending messages, and duplicate sends.Evidence reviewed
What I checked:
src/agents/cli-credentials.ts:185, c3b63ff4c0ec)src/agents/model-auth-model.ts:125, c3b63ff4c0ec)src/agents/cli-credentials.test.ts:336, c3b63ff4c0ec)src/infra/device-auth-store.ts:123, c3b63ff4c0ec)src/agents/cli-credentials.ts:185, f79553bef61f)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 explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 15, 2026, 7:40 PM ET / 23:40 UTC.
fix(gateway): add sync shims + revert public API to sync (openclaw#78805
fix(gateway): clean up lint errors — remove dead async fns, fix impor…
fix(gateway): restore execSync injection for testability, fix stray e…
davidjoshua7692-code commentedon May 15, 2026
👍 Also seeing this on Linux (WSL2) with Telegram channel.
Verbose log shows the same pattern:
The
channels.telegram.start-accountphase consistently blocks the event loop for 7-8 seconds, which also causesfetch-timeoutwarnings for other concurrent operations.Hope the async refactor can cover all channel types, not just WhatsApp. Happy to provide more verbose logs if needed!
htqx2022-art commentedon May 17, 2026
Still experiencing this on v2026.5.12 (Windows, Telegram channel). Liveness warnings show event loop delays up to 16 seconds:
This is particularly painful during startup and model-resolution phases. Combined with Moonshot API's occasional 429 rate limits, a single user message can take 3-4 minutes to get a response.
PR #78818 has been open for a while with no maintainer review. Is there a timeline for addressing the synchronous I/O hotspots? This is a fundamental architecture issue that degrades the experience for all users, especially those running OpenClaw as a persistent service (e.g., Telegram bot).
openclaw-barnacle commentedon Jun 1, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
51 remaining items
openclaw-barnacle commentedon Sep 20, 2026
This bug report has been automatically marked as stale due to inactivity.
ClawSweeper is checking whether current
mainalready fixes the reported behavior.Inactivity alone will not close a bug report.
steipete commentedon Oct 24, 2026
Thanks for filing this. We're closing older issues that no longer look actionable on current
main.The cited sync I/O paths are now guarded or worker-backed, and we couldn't confirm these freezes on current main. If you still see long event-loop stalls on a current release, please open a fresh issue with a timing trace.