Problem
discoverOpenClawPlugins() is called independently by multiple plugin subsystems during the same startup flow. Each call performs an identical filesystem walk to discover plugin candidates. When callers like loadBundledCapabilityRuntimeRegistry, resolveBundledPluginSources, and listChannelCatalogEntries are invoked in sequence with the same parameters, the walk repeats unnecessarily.
Impact
Redundant I/O during startup. The effect scales with the number of installed plugins and the depth of the plugin directory tree.
Expected behavior
Callers that already hold a PluginDiscoveryResult from an earlier step in the same flow should be able to pass it through, skipping the redundant filesystem walk while keeping discoverOpenClawPlugins itself stateless (no hidden global cache).
Affected files
| File |
Role |
src/plugins/bundled-capability-runtime.ts |
Calls discovery independently |
src/plugins/contracts/registry.ts |
Retry loop re-discovers on each attempt |
src/plugins/bundled-sources.ts |
Calls discovery independently |
src/plugins/channel-catalog-registry.ts |
Calls discovery independently |
Design constraint
discoverOpenClawPlugins() must remain stateless with no hidden cache. Discovery sharing should be function-scoped, not module-level.
Related
Problem
discoverOpenClawPlugins()is called independently by multiple plugin subsystems during the same startup flow. Each call performs an identical filesystem walk to discover plugin candidates. When callers likeloadBundledCapabilityRuntimeRegistry,resolveBundledPluginSources, andlistChannelCatalogEntriesare invoked in sequence with the same parameters, the walk repeats unnecessarily.Impact
Redundant I/O during startup. The effect scales with the number of installed plugins and the depth of the plugin directory tree.
Expected behavior
Callers that already hold a
PluginDiscoveryResultfrom an earlier step in the same flow should be able to pass it through, skipping the redundant filesystem walk while keepingdiscoverOpenClawPluginsitself stateless (no hidden global cache).Affected files
src/plugins/bundled-capability-runtime.tssrc/plugins/contracts/registry.tssrc/plugins/bundled-sources.tssrc/plugins/channel-catalog-registry.tsDesign constraint
discoverOpenClawPlugins()must remain stateless with no hidden cache. Discovery sharing should be function-scoped, not module-level.Related
discovery?parameter through the call chain