fix(nodes): remove redundant rawCommand from system.run.prepare

The nodes tool was passing rawCommand: formatExecCommand(command) to
system.run.prepare, which produced the full formatted argv string
(e.g. 'powershell -Command "echo hello"'). However,
validateSystemRunCommandConsistency() recognizes shell wrappers like
powershell/bash and extracts the inner command as the 'inferred' value
(e.g. 'echo hello'). This caused a rawCommand vs inferred mismatch,
breaking all nodes run commands with shell wrappers.

The fix removes the explicit rawCommand parameter, letting the
validation correctly infer the command text from the argv array.

Fixes #33080
This commit is contained in:
Felipe
2026-03-07 08:20:37 +01:00
committed by Ayaan Zaidi
parent 8db5d67768
commit 3efafab21b

View File

@@ -18,7 +18,6 @@ import {
import { parseDurationMs } from "../../cli/parse-duration.js";
import type { OpenClawConfig } from "../../config/config.js";
import { parsePreparedSystemRunPayload } from "../../infra/system-run-approval-context.js";
import { formatExecCommand } from "../../infra/system-run-command.js";
import { imageMimeFromFormat } from "../../media/mime.js";
import type { GatewayMessageChannel } from "../../utils/message-channel.js";
import { resolveSessionAgentId } from "../agent-scope.js";
@@ -651,7 +650,6 @@ export function createNodesTool(options?: {
command: "system.run.prepare",
params: {
command,
rawCommand: formatExecCommand(command),
cwd,
agentId,
sessionKey,