How to Fix OpenClaw Gateway Freezing, Plugin Failures, and Event Loop Stalls (WSL2)

✓ Verified Fix

If you’re running OpenClaw Gateway on WSL2 and your agentic workflows have started freezing mid-task, throwing plugin errors after an update, or stalling with liveness warnings in the logs — this guide covers the exact fix. The problem isn’t your hardware and it isn’t your model config. It’s a combination of orphaned session data, missing compiled plugin output, and a core version carrying too many heavy dependencies for shared-memory hardware.

This happened across minor versions v2026.5.2 through v2026.5.11. Ten tasks queued and stuck. Two categories of plugin failures. One agent silently stripped of its fallback model. Here’s what caused each one and the exact commands that fixed them.

The error messages that give it away:

If your logs are showing this on every stall:

liveness warning: reasons=event_loop_delay interval=31s eventLoopDelayP99Ms=20.7 eventLoopDelayMaxMs=1071.1 eventLoopUtilization=0.105 cpuCoreRatio=0.117 active=0 waiting=0 queued=2 recentPhases=sidecars.subagent-recovery:13ms,sidecars.main-session-recovery:7ms,post-attach.update-sentinel:0ms,sidecars.session-locks:68ms,sidecars.model-prewarm:1102ms,post-ready.maintenance:169ms work=[queued=agent:cto:main(idle/model_call,q=2,age=12s last=model_call:started)]

That sidecars.model-prewarm:1102ms is the smoking gun — the model warmup is blocking the entire event loop.

After a core update, if your TypeScript plugins stopped executing entirely:

plugins: plugin: installed plugin package requires compiled runtime output for TypeScript entry setup-entry.ts: expected ./dist/setup-entry.js, ./dist/setup-entry.mjs, ./dist/setup-entry.cjs, setup-entry.js, setup-entry.mjs, setup-entry.cjs
plugins: plugin: installed plugin package requires compiled runtime output for TypeScript entry index.ts: expected ./dist/index.js, ./dist/index.mjs, ./dist/index.cjs, index.js, index.mjs, index.cjs

And if your security log is showing this on every startup:

[plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: lossless-claw (/home/ahsan/.openclaw/npm/node_modules/@martian-engineering/lossless-claw/dist/index.js). Set plugins.allow to explicit trusted ids.

All three have different causes and different fixes. Here’s how to solve all of them in order.


Why OpenClaw stalls on shared-memory hardware

WSL2 on a machine with Intel Iris Xe Graphics means your GPU and system RAM share the same 16GB pool. OpenClaw versions prior to v2026.5.12 shipped with heavy SDK dependencies baked into the core — WhatsApp, Slack, AWS — loading 67 modules at startup regardless of whether you use them. On a machine with constrained shared memory, that’s enough to push model-prewarm blocking times past 1000ms and trigger the event loop delay watchdog on every session.

Upgrading to v2026.5.12 dropped the active module count from 67 to 6. That single change eliminated the stalls.


Step 1: Upgrade to the current stable release

Don’t attempt session repairs or plugin fixes on an unstable version — you’ll be patching symptoms. Upgrade first:

curl -fsSL https://openclaw.ai/install.sh | bash

After the upgrade completes, verify your active module count has dropped. If you were on v2026.5.11 or earlier, you should see the core footprint significantly reduced on next startup.

One version to avoid: v2026.5.5-beta.1 introduced socket connection failures (code 1000) and elevated loop utilization. Stay on stable tags when diagnosing production issues.


Step 2: Prune orphaned session data

Hard stalls and forced restarts leave broken structural arrays in your session store. These block the task queue on next startup even after the underlying model issue is resolved.

Force-clean the session store:

openclaw sessions cleanup --store "/home/ahsan/.openclaw/agents/main/sessions/sessions.json" --enforce --fix-missing

The --enforce flag catches corruption that the standard cleanup pass misses. Without it, ghost transcripts with broken array layouts stay in the store and the queue stays blocked.


Step 3: Repair peer dependencies and compiled plugin output

The TypeScript plugin errors aren’t a plugin problem — they’re a peer dependency problem. After a core version change, the workspace bindings for @martian-engineering/lossless-claw point to paths that no longer exist. Running npm run build manually in the skills directory won’t fix it because the managed /npm/node_modules path is what’s broken, not your local workspace.

Let the doctor engine repair the bindings:

openclaw doctor --fix

This regenerates the required /node_modules/openclaw peer paths dynamically and produces the compiled output (/dist/index.js, /dist/setup-entry.js) that the runtime is looking for. After this runs, the TypeScript plugin errors should be gone on next startup.


Step 4: Declare explicit plugin trust boundaries

With plugins.allow empty, OpenClaw will attempt to auto-load any discovered non-bundled plugin at startup — and log a security warning every time it does. This isn’t just noise; auto-loaded plugins that haven’t been explicitly trusted can destabilize the runtime.

Set the allowlist explicitly:

openclaw config set plugins.allow '["lossless-claw"]'

Add any other plugins you use to the same array. If you add custom skills or visual rendering plugins to an agent’s alsoAllow settings, they also need to appear here or they’ll be silently dropped at runtime with no error.


Step 5: Clean up legacy environment variables

If you accumulated environment variable workarounds during earlier debugging sessions, strip them out of ~/.bashrc now. Legacy hooks like LCM_ENABLED, LCM_SUMMARY_MODEL, and the old OPENCLAW_NO_RESPAWN can interfere with the optimized startup path in v2026.5.12.

Replace them with the caching configuration recommended for low-power shared hosts:

export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
mkdir -p /var/tmp/openclaw-compile-cache
export OPENCLAW_NO_RESPAWN=1

Reload your shell after editing:

source ~/.bashrc

FAQ

Can I fix the TypeScript plugin errors without running openclaw doctor? Technically yes — you can manually relink the peer paths — but it’s not worth it. The doctor engine knows exactly which bindings broke during the version transition and regenerates them correctly. Manual relinking against the managed /npm/node_modules path is fragile and will break again on the next upgrade.

What happens if I leave plugins.allow empty? Non-bundled plugins will still load — OpenClaw logs a warning but doesn’t block them. The risk is that an untrusted or outdated plugin loads into the runtime without your explicit approval. On a production agent setup, that’s how you get silent behavioral changes that are hard to trace.

Will this fix work on v2026.5.5-beta.1? No. The beta introduced upstream regressions including socket failures (code 1000) that make the session cleanup and doctor steps unreliable. Downgrade to the current stable release first, then follow this guide.


Errors you can safely ignore

plugin runtime config.loadConfig() is deprecated (runtime-config-load-write) — this comes from @martian-engineering/lossless-claw using an older API call. It doesn’t cause failures, it’s just a deprecation notice. Watch for a future update to Lossless Claw that migrates to config.current().


Tested on: WSL2 / Ubuntu, Intel Core i7-1165G7, Intel Iris Xe Graphics (shared memory), 16GB RAM, Node.js v25.8.2, npm v11.11.1, OpenClaw v2026.5.12. Active troubleshooting time: approximately 1–2 hours. Tools used: OpenClaw CLI, Homebrew Node.js, npm, bash.