From 7abca33790895a3d31841c5e18cf555802eee09c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 23:18:47 +0100 Subject: [PATCH] refactor: remove stale plugin runtime deps reload planning --- src/gateway/config-reload-plan.ts | 29 ------------------------- src/gateway/config-reload.test.ts | 6 ----- src/gateway/config-reload.ts | 1 - src/gateway/server-aux-handlers.test.ts | 1 - 4 files changed, 37 deletions(-) diff --git a/src/gateway/config-reload-plan.ts b/src/gateway/config-reload-plan.ts index 29ec73212a3..fbd348ef6d0 100644 --- a/src/gateway/config-reload-plan.ts +++ b/src/gateway/config-reload-plan.ts @@ -20,7 +20,6 @@ export type GatewayReloadPlan = { restartHealthMonitor: boolean; restartChannels: Set; disposeMcpRuntimes: boolean; - planPluginRuntimeDeps: boolean; noopPaths: string[]; }; @@ -123,24 +122,6 @@ const BASE_RELOAD_RULES_TAIL: ReloadRule[] = [ { prefix: "canvasHost", kind: "restart" }, ]; -const PLUGIN_RUNTIME_DEPS_PLAN_PREFIXES = [ - "auth.order", - "auth.profiles", - "channels", - "models.providers", - "plugins", - "agents.list", - "agents.defaults.imageGenerationModel", - "agents.defaults.imageModel", - "agents.defaults.memorySearch", - "agents.defaults.model", - "agents.defaults.models", - "agents.defaults.musicGenerationModel", - "agents.defaults.pdfModel", - "agents.defaults.subagents.model", - "agents.defaults.videoGenerationModel", -] as const; - let cachedReloadRules: ReloadRule[] | null = null; let cachedRegistry: ReturnType | null = null; let cachedActiveRegistryVersion = -1; @@ -230,12 +211,6 @@ function isPluginInstallTimestampPath(path: string): boolean { return /^plugins\.installs\..+\.(installedAt|resolvedAt)$/.test(path); } -function shouldPlanPluginRuntimeDepsForPath(path: string): boolean { - return PLUGIN_RUNTIME_DEPS_PLAN_PREFIXES.some( - (prefix) => path === prefix || path.startsWith(`${prefix}.`), - ); -} - function getPluginInstallRecords(config: unknown): Record { if (!isPlainObject(config)) { return {}; @@ -313,7 +288,6 @@ export function buildGatewayReloadPlan( restartHealthMonitor: false, restartChannels: new Set(), disposeMcpRuntimes: false, - planPluginRuntimeDeps: false, noopPaths: [], }; @@ -355,9 +329,6 @@ export function buildGatewayReloadPlan( plan.noopPaths.push(path); continue; } - if (shouldPlanPluginRuntimeDepsForPath(path)) { - plan.planPluginRuntimeDeps = true; - } const rule = matchRule(path); if (!rule) { plan.restartGateway = true; diff --git a/src/gateway/config-reload.test.ts b/src/gateway/config-reload.test.ts index 9071144bd08..8e4af2faf5b 100644 --- a/src/gateway/config-reload.test.ts +++ b/src/gateway/config-reload.test.ts @@ -214,7 +214,6 @@ describe("buildGatewayReloadPlan", () => { ); expect(expected.size).toBeGreaterThan(0); expect(plan.restartChannels).toEqual(expected); - expect(plan.planPluginRuntimeDeps).toBe(true); }); it("refreshes channel reload rules when only the tracked channel registry changes", () => { @@ -241,7 +240,6 @@ describe("buildGatewayReloadPlan", () => { ]); expect(plan.restartGateway).toBe(false); expect(plan.restartHeartbeat).toBe(true); - expect(plan.planPluginRuntimeDeps).toBe(true); expect(plan.hotReasons).toEqual( expect.arrayContaining(["models.providers.openai.models", "agents.defaults.model"]), ); @@ -259,7 +257,6 @@ describe("buildGatewayReloadPlan", () => { const plan = buildGatewayReloadPlan(["agents.defaults.models"]); expect(plan.restartGateway).toBe(false); expect(plan.restartHeartbeat).toBe(true); - expect(plan.planPluginRuntimeDeps).toBe(true); expect(plan.hotReasons).toContain("agents.defaults.models"); expect(plan.noopPaths).toEqual([]); }); @@ -268,7 +265,6 @@ describe("buildGatewayReloadPlan", () => { const plan = buildGatewayReloadPlan(["agents.list"]); expect(plan.restartGateway).toBe(false); expect(plan.restartHeartbeat).toBe(true); - expect(plan.planPluginRuntimeDeps).toBe(true); expect(plan.hotReasons).toContain("agents.list"); expect(plan.noopPaths).toEqual([]); }); @@ -279,7 +275,6 @@ describe("buildGatewayReloadPlan", () => { "plugins.installs.lossless-claw.installedAt", ]); expect(plan.restartGateway).toBe(false); - expect(plan.planPluginRuntimeDeps).toBe(false); expect(plan.noopPaths).toEqual([ "plugins.installs.lossless-claw.resolvedAt", "plugins.installs.lossless-claw.installedAt", @@ -351,7 +346,6 @@ describe("buildGatewayReloadPlan", () => { it("treats secrets config changes as no-op for gateway restart planning", () => { const plan = buildGatewayReloadPlan(["secrets.providers.default.path"]); expect(plan.restartGateway).toBe(false); - expect(plan.planPluginRuntimeDeps).toBe(false); expect(plan.noopPaths).toContain("secrets.providers.default.path"); }); diff --git a/src/gateway/config-reload.ts b/src/gateway/config-reload.ts index 27a8ec2717f..723b6eef1df 100644 --- a/src/gateway/config-reload.ts +++ b/src/gateway/config-reload.ts @@ -72,7 +72,6 @@ function isNoopReloadPlan(plan: GatewayReloadPlan): boolean { !plan.restartHeartbeat && !plan.restartHealthMonitor && !plan.disposeMcpRuntimes && - !plan.planPluginRuntimeDeps && plan.restartChannels.size === 0 ); } diff --git a/src/gateway/server-aux-handlers.test.ts b/src/gateway/server-aux-handlers.test.ts index 55b8f4d28d3..6a7b867a406 100644 --- a/src/gateway/server-aux-handlers.test.ts +++ b/src/gateway/server-aux-handlers.test.ts @@ -26,7 +26,6 @@ function createReloadPlan(overrides?: Partial): GatewayReload restartHealthMonitor: overrides?.restartHealthMonitor ?? false, restartChannels: overrides?.restartChannels ?? new Set(), disposeMcpRuntimes: overrides?.disposeMcpRuntimes ?? false, - planPluginRuntimeDeps: overrides?.planPluginRuntimeDeps ?? false, noopPaths: overrides?.noopPaths ?? [], }; }