惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Y
Y Combinator Blog
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
博客园 - 司徒正美
V
Visual Studio Blog
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
The Cloudflare Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(exec): fallback when node lacks run prepare · opencla...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -15,6 +15,8 @@ import {

1515

} from "../infra/exec-inline-eval.js";

1616

import { buildNodeShellCommand } from "../infra/node-shell.js";

1717

import { parsePreparedSystemRunPayload } from "../infra/system-run-approval-context.js";

18+

import { formatExecCommand, resolveSystemRunCommandRequest } from "../infra/system-run-command.js";

19+

import { normalizeNullableString } from "../shared/string-coerce.js";

1820

import type { ExecuteNodeHostCommandParams } from "./bash-tools.exec-host-node.js";

1921

import type { ExecToolDetails } from "./bash-tools.exec-types.js";

2022

import { callGatewayTool } from "./tools/gateway.js";

@@ -26,6 +28,7 @@ export type NodeExecutionTarget = {

2628

argv: string[];

2729

env: Record<string, string> | undefined;

2830

invokeTimeoutMs: number;

31+

supportsSystemRunPrepare: boolean;

2932

};

30333134

export type PreparedNodeRun = {

@@ -113,9 +116,8 @@ export async function resolveNodeExecutionTarget(

113116

throw err;

114117

}

115118

const nodeInfo = nodes.find((entry) => entry.nodeId === nodeId);

116-

const supportsSystemRun = Array.isArray(nodeInfo?.commands)

117-

? nodeInfo?.commands?.includes("system.run")

118-

: false;

119+

const declaredCommands = Array.isArray(nodeInfo?.commands) ? nodeInfo.commands : [];

120+

const supportsSystemRun = declaredCommands.includes("system.run");

119121

if (!supportsSystemRun) {

120122

throw new Error(

121123

"exec host=node requires a node that supports system.run (companion app or node host).",

@@ -133,6 +135,7 @@ export async function resolveNodeExecutionTarget(

133135

1000 +

134136

5_000,

135137

),

138+

supportsSystemRunPrepare: declaredCommands.includes("system.run.prepare"),

136139

};

137140

}

138141

@@ -199,6 +202,10 @@ export async function prepareNodeSystemRun(params: {

199202

request: ExecuteNodeHostCommandParams;

200203

target: NodeExecutionTarget;

201204

}): Promise<PreparedNodeRun> {

205+

if (!params.target.supportsSystemRunPrepare) {

206+

return buildLocalPreparedNodeRun(params);

207+

}

208+202209

const prepareRaw = await callGatewayTool(

203210

"node.invoke",

204211

{ timeoutMs: 15_000 },

@@ -229,6 +236,41 @@ export async function prepareNodeSystemRun(params: {

229236

};

230237

}

231238239+

function buildLocalPreparedNodeRun(params: {

240+

request: ExecuteNodeHostCommandParams;

241+

target: NodeExecutionTarget;

242+

}): PreparedNodeRun {

243+

const command = resolveSystemRunCommandRequest({

244+

command: params.target.argv,

245+

rawCommand: params.request.command,

246+

});

247+

if (!command.ok) {

248+

throw new Error(command.message);

249+

}

250+

if (command.argv.length === 0) {

251+

throw new Error("command required");

252+

}

253+

const commandText = formatExecCommand(command.argv);

254+

const previewText = command.previewText?.trim();

255+

const commandPreview = previewText && previewText !== commandText ? previewText : null;

256+

const plan = {

257+

argv: [...command.argv],

258+

cwd: normalizeNullableString(params.request.workdir),

259+

commandText,

260+

commandPreview,

261+

agentId: normalizeNullableString(params.request.agentId),

262+

sessionKey: normalizeNullableString(params.request.sessionKey),

263+

} satisfies SystemRunApprovalPlan;

264+

return {

265+

plan,

266+

argv: plan.argv,

267+

rawCommand: plan.commandText,

268+

cwd: plan.cwd ?? params.request.workdir,

269+

agentId: plan.agentId ?? params.request.agentId,

270+

sessionKey: plan.sessionKey ?? params.request.sessionKey,

271+

};

272+

}

273+232274

export async function analyzeNodeApprovalRequirement(params: {

233275

request: ExecuteNodeHostCommandParams;

234276

target: NodeExecutionTarget;