OpenClaw Freezes for 5–7 Minutes on Windows Startup (Multi-Agent Bug)
If you've configured OpenClaw with 2 or more agents (each with its own workspace) and you're on Windows, you may have noticed the gateway completely freezes after printing "starting channels and sidecars..." — for anywhere from 5 to 7 minutes. Discord bots never come online. HTTP health endpoints don't respond. It looks like a crash, but it isn't.
What's Actually Happening
The culprit is synchronous plugin discovery inside OpenClaw's core. On every boot, the gateway calls discoverOpenClawPlugins(), which performs approximately 62,000 synchronous filesystem calls — realpathSync, existsSync, readFileSync — to scan the 102+ bundled extensions.
On Windows, each sync file call is slow. A single full scan takes ~85 seconds. But here's the kicker: the in-memory discovery cache has a default TTL of 1 second (DEFAULT_DISCOVERY_CACHE_MS = 1e3), and the cache key includes the workspaceDir. With 4 agents on 4 different workspaces, each initialization triggers an independent full rescan — bypassing the cache entirely.
The math: 4 agents × 85 seconds = ~5–7 minutes of a completely blocked event loop.
During that window, Discord's 15-second gateway readiness timeout fires repeatedly, creating an infinite zombie restart loop where the bot never comes online.
Am I Affected?
You're likely affected if:
- You're on Windows (WSL users on Linux are not impacted to the same degree)
- You have 2+ agents configured with different workspace paths
- Your gateway log freezes at
"starting channels and sidecars..." - Discord bots show as offline or bounce in a restart loop
Workarounds (Until a Fix Ships)
1. Consolidate to a Single Workspace
If your agents don't strictly need separate workspaces, point them all at the same workspace directory. This collapses 4 full rescans into 1 (and the cache actually hits on scans 2–4).
2. Stagger Agent Startup
Start agents one at a time with a delay between each. This doesn't eliminate the hang, but prevents the Discord reconnect loop from spiraling. A simple wrapper script with timeout /T 120 between agent starts helps.
3. Run in WSL Instead of Native Windows
The Linux filesystem in WSL2 handles sync calls significantly faster than Windows NTFS. If you're on Windows 10/11, running OpenClaw inside WSL2 largely eliminates this problem — the same 62,000 calls complete in a few seconds instead of 85 seconds.
4. Wait for the Upstream Fix
The suggested upstream fixes are clearly documented in the issue:
- Make plugin discovery async (replace
realpathSync/existsSync/readFileSyncwith async equivalents) - Increase default cache TTL from 1s to at least 60s
- Cache the bundled extensions scan separately from per-workspace scans
Track fix progress at issue #67869.
Quick Diagnosis
# Run gateway in the foreground and time the startup freeze
openclaw gateway start --no-detach
# You'll see:
# [gateway] starting channels and sidecars...
# (... nothing for 5+ minutes on affected systems ...)
# [gateway] discord channel ready
Need Help?
If you're hitting this bug and need help restructuring your multi-agent setup — or migrating to WSL — ClawReady's setup service covers exactly this. We've seen this pattern a lot on Windows deployments.