-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
DefaultResourceLoader.reload() blocks event loop for 12-15s on Windows due to synchronous filesystem scanning #79899
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper: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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper: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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
DefaultResourceLoader.reload()from@mariozechner/pi-coding-agentblocks the Node.js event loop for 12-15 seconds on every agent run on Windows/NTFS. This is caused by extensive use of synchronous filesystem operations:readdirSync,statSync,readFileSync,existsSync— 21+ occurrences inresource-loader.js, 15+ indiscovery-CVL9-KJt.jsreload()callDirectories scanned on every reload()
~/.openclaw/extensions,~/.openclaw/skills,~/.openclaw/prompts,~/.openclaw/themes<workspace>/.openclaw/extensions,<workspace>/.openclaw/skills, etc.~/.agents/skillscollectAncestorAgentsSkillDirs()Impact
eventLoopDelayP99Ms=12297ms,eventLoopUtilization=1.0GatewayTransportError: gateway timeout after 10000mschat.history200-3800ms,node.list248-2258msLog evidence
session-resource-loaderalone accounts for 80% of prep time.Environment
Proposed fixes
fs.promises.*(though the reload must complete before the run starts, so this alone would not reduce total time — but it would stop blocking the event loop)DefaultResourceLoaderalready supportsnoExtensions,noSkills,noThemes,noPromptTemplates,noContextFilesconstructor options, but OpenClaw does not expose these via config. Adding config options likeagents.defaults.skipResourceTypes: ["themes", "prompts"]would let users opt out of unused resource types.