extensions/acpx: align probeAgent with current config surface · openclaw/openclaw@6fb55f8
steipete
·
2026-04-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,6 +30,7 @@ declare module "acpx/runtime" {
|
30 | 30 | permissionMode?: unknown; |
31 | 31 | nonInteractivePermissions?: unknown; |
32 | 32 | timeoutMs?: number; |
| 33 | +probeAgent?: string; |
33 | 34 | }; |
34 | 35 | |
35 | 36 | export class AcpxRuntime { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,7 +34,6 @@ export type AcpxPluginConfig = {
|
34 | 34 | strictWindowsCmdWrapper?: boolean; |
35 | 35 | timeoutSeconds?: number; |
36 | 36 | queueOwnerTtlSeconds?: number; |
37 | | -probeAgent?: string; |
38 | 37 | mcpServers?: Record<string, McpServerConfig>; |
39 | 38 | agents?: Record<string, { command: string }>; |
40 | 39 | }; |
@@ -50,7 +49,6 @@ export type ResolvedAcpxPluginConfig = {
|
50 | 49 | strictWindowsCmdWrapper: boolean; |
51 | 50 | timeoutSeconds?: number; |
52 | 51 | queueOwnerTtlSeconds: number; |
53 | | -probeAgent?: string; |
54 | 52 | legacyCompatibilityConfig: { |
55 | 53 | strictWindowsCmdWrapper?: boolean; |
56 | 54 | queueOwnerTtlSeconds?: number; |
@@ -109,7 +107,6 @@ export const AcpxPluginConfigSchema = z.strictObject({
|
109 | 107 | .number({ error: "queueOwnerTtlSeconds must be a number >= 0" }) |
110 | 108 | .min(0, { error: "queueOwnerTtlSeconds must be a number >= 0" }) |
111 | 109 | .optional(), |
112 | | -probeAgent: nonEmptyTrimmedString("probeAgent must be a non-empty string").optional(), |
113 | 110 | mcpServers: z.record(z.string(), McpServerConfigSchema).optional(), |
114 | 111 | agents: z |
115 | 112 | .record( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -260,12 +260,16 @@ export function resolveAcpxPluginConfig(params: {
|
260 | 260 | ]), |
261 | 261 | ); |
262 | 262 | |
263 | | -const probeAgent = normalized.probeAgent?.trim(); |
| 263 | +// Lowercase probeAgent so lookups match the registry keys built above, which |
| 264 | +// also go through normalizeLowercaseStringOrEmpty. Without this, a user who |
| 265 | +// writes `probeAgent: "OpenCode"` would silently miss the stored "opencode" |
| 266 | +// key. |
| 267 | +const probeAgent = normalizeLowercaseStringOrEmpty(normalized.probeAgent) || undefined; |
264 | 268 | |
265 | 269 | return { |
266 | 270 | cwd, |
267 | 271 | stateDir, |
268 | | -probeAgent: normalized.probeAgent, |
| 272 | + probeAgent, |
269 | 273 | permissionMode: normalized.permissionMode ?? DEFAULT_PERMISSION_MODE, |
270 | 274 | nonInteractivePermissions: |
271 | 275 | normalized.nonInteractivePermissions ?? DEFAULT_NON_INTERACTIVE_POLICY, |
@@ -275,7 +279,6 @@ export function resolveAcpxPluginConfig(params: {
|
275 | 279 | normalized.strictWindowsCmdWrapper ?? DEFAULT_STRICT_WINDOWS_CMD_WRAPPER, |
276 | 280 | timeoutSeconds: normalized.timeoutSeconds ?? DEFAULT_ACPX_TIMEOUT_SECONDS, |
277 | 281 | queueOwnerTtlSeconds: normalized.queueOwnerTtlSeconds ?? DEFAULT_QUEUE_OWNER_TTL_SECONDS, |
278 | | -probeAgent: probeAgent && probeAgent.length > 0 ? probeAgent : undefined, |
279 | 282 | legacyCompatibilityConfig: { |
280 | 283 | strictWindowsCmdWrapper: normalized.strictWindowsCmdWrapper, |
281 | 284 | queueOwnerTtlSeconds: normalized.queueOwnerTtlSeconds, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,6 @@ function createDefaultRuntime(params: AcpxRuntimeFactoryParams): AcpxRuntimeLike
|
53 | 53 | mcpServers: toAcpMcpServers(params.pluginConfig.mcpServers), |
54 | 54 | permissionMode: params.pluginConfig.permissionMode, |
55 | 55 | nonInteractivePermissions: params.pluginConfig.nonInteractivePermissions, |
56 | | -probeAgent: params.pluginConfig.probeAgent, |
57 | 56 | timeoutMs: |
58 | 57 | params.pluginConfig.timeoutSeconds != null |
59 | 58 | ? params.pluginConfig.timeoutSeconds * 1_000 |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。