fix(plugins): reuse gateway lifecycle metadata and isolate plugin state (#114476)

* fix(plugins): reuse gateway metadata and preserve reload isolation

* test(plugins): split lifecycle regressions and simplify gateway dispatch

* perf(plugins): reuse proven immutable snapshot graphs

* test(plugins): isolate snapshot lifecycle regression mocks

* perf(plugins): retain one gateway metadata cache

* test(plugins): preserve frozen proxy descriptor invariants

* test(plugins): isolate lifecycle metadata mock ownership

* test(plugins): bind shared worker mocks before module evaluation
This commit is contained in:
Peter Steinberger
2026-07-27 07:48:13 -04:00
committed by GitHub
parent 91f04499f5
commit 3fb201c5a7
36 changed files with 2259 additions and 245 deletions
+3 -2
View File
@@ -258,7 +258,6 @@ function createPluginModuleLoader(params: {
allowWindows: true,
aliasMap: params.aliasMap,
fallbackOnMissingDependency: true,
fallbackOnNativeError: true,
});
if (native.ok) {
pluginModuleLoaderStats.nativeHits += 1;
@@ -277,12 +276,14 @@ export function getCachedPluginModuleLoader(
createLoader?: PluginModuleLoaderFactory;
},
): PluginModuleLoader {
installOpenClawInternalCorePackageNativeResolver({ moduleUrl: params.importerUrl });
const cacheEntry = resolvePluginModuleLoaderCacheEntry(params);
const cached = params.cache.get(cacheEntry.scopedCacheKey);
if (cached) {
return cached;
}
// Exact-key hits already own the native aliases installed with their loader;
// reinstallation would rescan the host package on every cached request.
installOpenClawInternalCorePackageNativeResolver({ moduleUrl: params.importerUrl });
const loader = createPluginModuleLoader({
loaderFilename: cacheEntry.loaderFilename,
aliasMap: cacheEntry.aliasMap,