perf(plugins): avoid duplicate provider hook load probes · openclaw/openclaw@12d4dda
steipete
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -336,6 +336,7 @@ export function resolvePluginProviders(params: {
|
336 | 336 | mode?: "runtime" | "setup"; |
337 | 337 | includeUntrustedWorkspacePlugins?: boolean; |
338 | 338 | pluginMetadataSnapshot?: PluginMetadataRegistryView; |
| 339 | +skipIfLoadInFlight?: boolean; |
339 | 340 | }): ProviderPlugin[] { |
340 | 341 | const { env, workspaceDir, snapshot } = resolveProviderMetadataLookup(params); |
341 | 342 | const base = resolvePluginProviderLoadBase({ ...params, workspaceDir, env }, snapshot); |
@@ -344,12 +345,18 @@ export function resolvePluginProviders(params: {
|
344 | 345 | if (!loadState) { |
345 | 346 | return []; |
346 | 347 | } |
| 348 | +if (params.skipIfLoadInFlight && isPluginRegistryLoadInFlight(loadState.loadOptions)) { |
| 349 | +return []; |
| 350 | +} |
347 | 351 | const registry = loadOpenClawPlugins(loadState.loadOptions); |
348 | 352 | return registry.providers.map((entry) => |
349 | 353 | Object.assign({}, entry.provider, { pluginId: entry.pluginId }), |
350 | 354 | ); |
351 | 355 | } |
352 | 356 | const loadState = resolveRuntimeProviderPluginLoadState(params, base, snapshot); |
| 357 | +if (params.skipIfLoadInFlight && isPluginRegistryLoadInFlight(loadState.loadOptions)) { |
| 358 | +return []; |
| 359 | +} |
353 | 360 | const registry = |
354 | 361 | loadState.loadOptions.onlyPluginIds?.length === 0 |
355 | 362 | ? undefined |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。