|
| 1 | +import { collectConfiguredAgentHarnessRuntimes } from "../agents/harness-runtimes.js"; |
1 | 2 | import { listPotentialConfiguredChannelIds } from "../channels/config-presence.js"; |
2 | 3 | import type { OpenClawConfig } from "../config/types.openclaw.js"; |
3 | 4 | import { |
@@ -50,33 +51,6 @@ function dedupeSortedPluginIds(values: Iterable<string>): string[] { |
50 | 51 | return [...new Set(values)].toSorted((left, right) => left.localeCompare(right)); |
51 | 52 | } |
52 | 53 |
|
53 | | -function collectRequestedAgentHarnessRuntimes( |
54 | | - config: OpenClawConfig, |
55 | | - env: NodeJS.ProcessEnv, |
56 | | -): string[] { |
57 | | - const runtimes = new Set<string>(); |
58 | | - const pushRuntime = (value: unknown) => { |
59 | | - const normalized = typeof value === "string" ? normalizeOptionalLowercaseString(value) : null; |
60 | | - if (!normalized || normalized === "auto" || normalized === "pi") { |
61 | | - return; |
62 | | - } |
63 | | - runtimes.add(normalized); |
64 | | - }; |
65 | | - |
66 | | - pushRuntime(config.agents?.defaults?.embeddedHarness?.runtime); |
67 | | - if (Array.isArray(config.agents?.list)) { |
68 | | - for (const entry of config.agents.list) { |
69 | | - if (!entry || typeof entry !== "object" || Array.isArray(entry)) { |
70 | | - continue; |
71 | | - } |
72 | | - pushRuntime((entry as { embeddedHarness?: { runtime?: string } }).embeddedHarness?.runtime); |
73 | | - } |
74 | | - } |
75 | | - pushRuntime(env.OPENCLAW_AGENT_RUNTIME); |
76 | | - |
77 | | - return [...runtimes].toSorted((left, right) => left.localeCompare(right)); |
78 | | -} |
79 | | - |
80 | 54 | function normalizeChannelIds(channelIds: Iterable<string>): string[] { |
81 | 55 | return Array.from( |
82 | 56 | new Set( |
@@ -300,19 +274,21 @@ export function resolveGatewayStartupPluginIds(params: { |
300 | 274 | config: params.activationSourceConfig ?? params.config, |
301 | 275 | }); |
302 | 276 | const requiredAgentHarnessPluginIds = new Set( |
303 | | - collectRequestedAgentHarnessRuntimes(params.activationSourceConfig ?? params.config, params.env) |
304 | | - .flatMap((runtime) => |
305 | | - resolveManifestActivationPluginIds({ |
306 | | - trigger: { |
307 | | - kind: "agentHarness", |
308 | | - runtime, |
309 | | - }, |
310 | | - config: params.config, |
311 | | - workspaceDir: params.workspaceDir, |
312 | | - env: params.env, |
313 | | - cache: true, |
314 | | - }), |
315 | | - ), |
| 277 | + collectConfiguredAgentHarnessRuntimes( |
| 278 | + params.activationSourceConfig ?? params.config, |
| 279 | + params.env, |
| 280 | + ).flatMap((runtime) => |
| 281 | + resolveManifestActivationPluginIds({ |
| 282 | + trigger: { |
| 283 | + kind: "agentHarness", |
| 284 | + runtime, |
| 285 | + }, |
| 286 | + config: params.config, |
| 287 | + workspaceDir: params.workspaceDir, |
| 288 | + env: params.env, |
| 289 | + cache: true, |
| 290 | + }), |
| 291 | + ), |
316 | 292 | ); |
317 | 293 | const startupDreamingPluginIds = resolveGatewayStartupDreamingPluginIds(params.config); |
318 | 294 | const explicitMemorySlotStartupPluginId = resolveExplicitMemorySlotStartupPluginId( |
|
0 commit comments