Skip to content

Commit 7abca33

Browse files
committed
refactor: remove stale plugin runtime deps reload planning
1 parent 566cbb2 commit 7abca33

4 files changed

Lines changed: 0 additions & 37 deletions

File tree

src/gateway/config-reload-plan.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export type GatewayReloadPlan = {
2020
restartHealthMonitor: boolean;
2121
restartChannels: Set<ChannelKind>;
2222
disposeMcpRuntimes: boolean;
23-
planPluginRuntimeDeps: boolean;
2423
noopPaths: string[];
2524
};
2625

@@ -123,24 +122,6 @@ const BASE_RELOAD_RULES_TAIL: ReloadRule[] = [
123122
{ prefix: "canvasHost", kind: "restart" },
124123
];
125124

126-
const PLUGIN_RUNTIME_DEPS_PLAN_PREFIXES = [
127-
"auth.order",
128-
"auth.profiles",
129-
"channels",
130-
"models.providers",
131-
"plugins",
132-
"agents.list",
133-
"agents.defaults.imageGenerationModel",
134-
"agents.defaults.imageModel",
135-
"agents.defaults.memorySearch",
136-
"agents.defaults.model",
137-
"agents.defaults.models",
138-
"agents.defaults.musicGenerationModel",
139-
"agents.defaults.pdfModel",
140-
"agents.defaults.subagents.model",
141-
"agents.defaults.videoGenerationModel",
142-
] as const;
143-
144125
let cachedReloadRules: ReloadRule[] | null = null;
145126
let cachedRegistry: ReturnType<typeof getActivePluginRegistry> | null = null;
146127
let cachedActiveRegistryVersion = -1;
@@ -230,12 +211,6 @@ function isPluginInstallTimestampPath(path: string): boolean {
230211
return /^plugins\.installs\..+\.(installedAt|resolvedAt)$/.test(path);
231212
}
232213

233-
function shouldPlanPluginRuntimeDepsForPath(path: string): boolean {
234-
return PLUGIN_RUNTIME_DEPS_PLAN_PREFIXES.some(
235-
(prefix) => path === prefix || path.startsWith(`${prefix}.`),
236-
);
237-
}
238-
239214
function getPluginInstallRecords(config: unknown): Record<string, unknown> {
240215
if (!isPlainObject(config)) {
241216
return {};
@@ -313,7 +288,6 @@ export function buildGatewayReloadPlan(
313288
restartHealthMonitor: false,
314289
restartChannels: new Set(),
315290
disposeMcpRuntimes: false,
316-
planPluginRuntimeDeps: false,
317291
noopPaths: [],
318292
};
319293

@@ -355,9 +329,6 @@ export function buildGatewayReloadPlan(
355329
plan.noopPaths.push(path);
356330
continue;
357331
}
358-
if (shouldPlanPluginRuntimeDepsForPath(path)) {
359-
plan.planPluginRuntimeDeps = true;
360-
}
361332
const rule = matchRule(path);
362333
if (!rule) {
363334
plan.restartGateway = true;

src/gateway/config-reload.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ describe("buildGatewayReloadPlan", () => {
214214
);
215215
expect(expected.size).toBeGreaterThan(0);
216216
expect(plan.restartChannels).toEqual(expected);
217-
expect(plan.planPluginRuntimeDeps).toBe(true);
218217
});
219218

220219
it("refreshes channel reload rules when only the tracked channel registry changes", () => {
@@ -241,7 +240,6 @@ describe("buildGatewayReloadPlan", () => {
241240
]);
242241
expect(plan.restartGateway).toBe(false);
243242
expect(plan.restartHeartbeat).toBe(true);
244-
expect(plan.planPluginRuntimeDeps).toBe(true);
245243
expect(plan.hotReasons).toEqual(
246244
expect.arrayContaining(["models.providers.openai.models", "agents.defaults.model"]),
247245
);
@@ -259,7 +257,6 @@ describe("buildGatewayReloadPlan", () => {
259257
const plan = buildGatewayReloadPlan(["agents.defaults.models"]);
260258
expect(plan.restartGateway).toBe(false);
261259
expect(plan.restartHeartbeat).toBe(true);
262-
expect(plan.planPluginRuntimeDeps).toBe(true);
263260
expect(plan.hotReasons).toContain("agents.defaults.models");
264261
expect(plan.noopPaths).toEqual([]);
265262
});
@@ -268,7 +265,6 @@ describe("buildGatewayReloadPlan", () => {
268265
const plan = buildGatewayReloadPlan(["agents.list"]);
269266
expect(plan.restartGateway).toBe(false);
270267
expect(plan.restartHeartbeat).toBe(true);
271-
expect(plan.planPluginRuntimeDeps).toBe(true);
272268
expect(plan.hotReasons).toContain("agents.list");
273269
expect(plan.noopPaths).toEqual([]);
274270
});
@@ -279,7 +275,6 @@ describe("buildGatewayReloadPlan", () => {
279275
"plugins.installs.lossless-claw.installedAt",
280276
]);
281277
expect(plan.restartGateway).toBe(false);
282-
expect(plan.planPluginRuntimeDeps).toBe(false);
283278
expect(plan.noopPaths).toEqual([
284279
"plugins.installs.lossless-claw.resolvedAt",
285280
"plugins.installs.lossless-claw.installedAt",
@@ -351,7 +346,6 @@ describe("buildGatewayReloadPlan", () => {
351346
it("treats secrets config changes as no-op for gateway restart planning", () => {
352347
const plan = buildGatewayReloadPlan(["secrets.providers.default.path"]);
353348
expect(plan.restartGateway).toBe(false);
354-
expect(plan.planPluginRuntimeDeps).toBe(false);
355349
expect(plan.noopPaths).toContain("secrets.providers.default.path");
356350
});
357351

src/gateway/config-reload.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function isNoopReloadPlan(plan: GatewayReloadPlan): boolean {
7272
!plan.restartHeartbeat &&
7373
!plan.restartHealthMonitor &&
7474
!plan.disposeMcpRuntimes &&
75-
!plan.planPluginRuntimeDeps &&
7675
plan.restartChannels.size === 0
7776
);
7877
}

src/gateway/server-aux-handlers.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function createReloadPlan(overrides?: Partial<GatewayReloadPlan>): GatewayReload
2626
restartHealthMonitor: overrides?.restartHealthMonitor ?? false,
2727
restartChannels: overrides?.restartChannels ?? new Set(),
2828
disposeMcpRuntimes: overrides?.disposeMcpRuntimes ?? false,
29-
planPluginRuntimeDeps: overrides?.planPluginRuntimeDeps ?? false,
3029
noopPaths: overrides?.noopPaths ?? [],
3130
};
3231
}

0 commit comments

Comments
 (0)