mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 22:31:25 +00:00
fix: ignore tools.exec.pathPrepend for node hosts
This commit is contained in:
@@ -316,7 +316,16 @@ export function createExecTool(
|
||||
});
|
||||
applyShellPath(env, shellPath);
|
||||
}
|
||||
applyPathPrepend(env, defaultPathPrepend);
|
||||
|
||||
// `tools.exec.pathPrepend` is only meaningful when exec runs locally (gateway) or in the sandbox.
|
||||
// Node hosts intentionally ignore request-scoped PATH overrides, so don't pretend this applies.
|
||||
if (host === "node" && defaultPathPrepend.length > 0) {
|
||||
warnings.push(
|
||||
"Warning: tools.exec.pathPrepend is ignored for host=node. Configure PATH on the node host/service instead.",
|
||||
);
|
||||
} else {
|
||||
applyPathPrepend(env, defaultPathPrepend);
|
||||
}
|
||||
|
||||
if (host === "node") {
|
||||
const approvals = resolveExecApprovals(agentId, { security, ask });
|
||||
@@ -362,10 +371,6 @@ export function createExecTool(
|
||||
const argv = buildNodeShellCommand(params.command, nodeInfo?.platform);
|
||||
|
||||
const nodeEnv = params.env ? { ...params.env } : undefined;
|
||||
|
||||
if (nodeEnv) {
|
||||
applyPathPrepend(nodeEnv, defaultPathPrepend, { requireExisting: true });
|
||||
}
|
||||
const baseAllowlistEval = evaluateShellAllowlist({
|
||||
command: params.command,
|
||||
allowlist: [],
|
||||
|
||||
Reference in New Issue
Block a user