mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-28 09:31:16 +00:00
* perf(plugins): cache existence probes within bundle manifest scan Bundle plugin discovery re-probes the same marker paths (skills/, commands/, agents/, .mcp.json, .lsp.json, settings.json, hooks/hooks.json) once in detectBundleManifestFormat and again in loadBundleManifest's capability builders. Across the bundled plugin tree this is thousands of redundant synchronous fs.existsSync calls; #76209 reports 25.4s of self-time on a Windows cold start. Add a scan-scoped existence cache (plugin-scan-existence-cache.ts) entered only around discoverBundleInRoot. pluginScanExistsSync memoizes inside the active scan and falls back to plain fs.existsSync outside it, so install, hooks, and doctor flows stay uncached. The cache is push/pop per discoverBundleInRoot call (try/finally), so a later install/repair pass re-reads the filesystem — no process-global staleness. Measured on Windows over a 25-plugin fixture: 550 -> 325 fs.existsSync calls (41% fewer), 294.75ms -> 208.49ms. Discovery results unchanged. Closes #76209 * fix(plugins): drop unused test reset helper and satisfy oxlint Remove __resetPluginScanExistenceCacheForTest: the scan cache is push/pop balanced by try/finally in withPluginScanExistenceCache, so the stack never leaks between tests and the helper was dead code. It also tripped oxlint no-underscore-dangle. Refactor the integration test to count existsSync calls via a const-returning helper so there is no useless assignment.
2.2 KiB
2.2 KiB