mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:10:44 +00:00
perf(plugins): avoid gateway method spread merge
This commit is contained in:
@@ -758,6 +758,14 @@ function hasExplicitCompatibilityInputs(options: PluginLoadOptions): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
function resolveCoreGatewayMethodNames(options: PluginLoadOptions): string[] {
|
||||
const names = new Set(options.coreGatewayMethodNames ?? []);
|
||||
for (const name of Object.keys(options.coreGatewayHandlers ?? {})) {
|
||||
names.add(name);
|
||||
}
|
||||
return Array.from(names).toSorted();
|
||||
}
|
||||
|
||||
function pluginLoadOptionsMatchCacheKey(
|
||||
options: PluginLoadOptions,
|
||||
expectedCacheKey: string,
|
||||
@@ -890,12 +898,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
|
||||
const preferSetupRuntimeForChannelPlugins = options.preferSetupRuntimeForChannelPlugins === true;
|
||||
const shouldInstallBundledRuntimeDeps = options.installBundledRuntimeDeps !== false;
|
||||
const runtimeSubagentMode = resolveRuntimeSubagentMode(options.runtimeOptions);
|
||||
const coreGatewayMethodNames = Array.from(
|
||||
new Set([
|
||||
...(options.coreGatewayMethodNames ?? []),
|
||||
...Object.keys(options.coreGatewayHandlers ?? {}),
|
||||
]),
|
||||
).toSorted();
|
||||
const coreGatewayMethodNames = resolveCoreGatewayMethodNames(options);
|
||||
const installRecords = {
|
||||
...loadInstalledPluginIndexInstallRecordsSync({ env }),
|
||||
...cfg.plugins?.installs,
|
||||
|
||||
Reference in New Issue
Block a user