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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
WordPress大学
WordPress大学
雷峰网
雷峰网
小众软件
小众软件
D
DataBreaches.Net
V
Visual Studio Blog
博客园 - Franky
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
博客园 - 聂微东
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
云风的 BLOG
云风的 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): honor node runtime policy for auto-review · op...
joshavant · 2026-05-29 · via Recent Commits to openclaw:main

@@ -148,6 +148,15 @@ type LayeredExecPolicy = {

148148

ask: ExecAsk;

149149

};

150150151+

type EffectiveSystemRunExecPolicy = {

152+

agentExec: ExecToolConfig | undefined;

153+

globalExec: ExecToolConfig | undefined;

154+

approvals: ReturnType<typeof resolveExecApprovals>;

155+

security: ExecSecurity;

156+

ask: ExecAsk;

157+

autoReview: boolean;

158+

};

159+151160

function hasLegacyExecPolicyOverride(exec?: ExecToolConfig): boolean {

152161

return exec?.security !== undefined || exec?.ask !== undefined;

153162

}

@@ -210,6 +219,45 @@ function resolveAgentExecConfig(

210219

return entry?.tools?.exec;

211220

}

212221222+

export function resolveEffectiveSystemRunExecPolicy(params: {

223+

cfg: OpenClawConfig;

224+

agentId: string | undefined;

225+

defaultSecurity: ExecSecurity;

226+

defaultAsk: ExecAsk;

227+

requireSocket: boolean;

228+

}): EffectiveSystemRunExecPolicy {

229+

const agentExec = resolveAgentExecConfig(params.cfg, params.agentId);

230+

const globalExec = params.cfg.tools?.exec;

231+

const layeredPolicy = applyExecPolicyLayer(

232+

applyExecPolicyLayer(

233+

{

234+

security: params.defaultSecurity,

235+

ask: params.defaultAsk,

236+

},

237+

globalExec,

238+

),

239+

agentExec,

240+

);

241+

const modePolicy = resolveExecModePolicy({

242+

mode: layeredPolicy.mode,

243+

security: layeredPolicy.security,

244+

ask: layeredPolicy.ask,

245+

});

246+

const approvals = resolveExecApprovals(params.agentId, {

247+

security: modePolicy.security,

248+

ask: modePolicy.ask,

249+

requireSocket: params.requireSocket,

250+

});

251+

return {

252+

agentExec,

253+

globalExec,

254+

approvals,

255+

security: minSecurity(modePolicy.security, approvals.agent.security),

256+

ask: maxAsk(modePolicy.ask, approvals.agent.ask),

257+

autoReview: modePolicy.autoReview,

258+

};

259+

}

260+213261

async function resolveSystemRunAutoReviewer(params: {

214262

opts: HandleSystemRunInvokeOptions;

215263

cfg: OpenClawConfig;

@@ -443,32 +491,14 @@ async function evaluateSystemRunPolicyPhase(

443491

parsed: SystemRunParsePhase,

444492

): Promise<SystemRunPolicyPhase | null> {

445493

const cfg = await loadSystemRunConfig(opts);

446-

const agentExec = resolveAgentExecConfig(cfg, parsed.agentId);

447-

const globalExec = cfg.tools?.exec;

448-

const layeredPolicy = applyExecPolicyLayer(

449-

applyExecPolicyLayer(

450-

{

451-

security: opts.resolveExecSecurity(undefined),

452-

ask: opts.resolveExecAsk(undefined),

453-

},

454-

globalExec,

455-

),

456-

agentExec,

457-

);

458-

const modePolicy = resolveExecModePolicy({

459-

mode: layeredPolicy.mode,

460-

security: layeredPolicy.security,

461-

ask: layeredPolicy.ask,

462-

});

463-

const configuredSecurity = modePolicy.security;

464-

const configuredAsk = modePolicy.ask;

465-

const approvals = resolveExecApprovals(parsed.agentId, {

466-

security: configuredSecurity,

467-

ask: configuredAsk,

494+

const effectivePolicy = resolveEffectiveSystemRunExecPolicy({

495+

cfg,

496+

agentId: parsed.agentId,

497+

defaultSecurity: opts.resolveExecSecurity(undefined),

498+

defaultAsk: opts.resolveExecAsk(undefined),

468499

requireSocket: opts.preferMacAppExecHost,

469500

});

470-

const security = minSecurity(configuredSecurity, approvals.agent.security);

471-

const ask = maxAsk(configuredAsk, approvals.agent.ask);

501+

const { agentExec, globalExec, approvals, security, ask } = effectivePolicy;

472502

const autoAllowSkills = approvals.agent.autoAllowSkills;

473503

const { safeBins, safeBinProfiles, trustedSafeBinDirs } = resolveExecSafeBinRuntimePolicy({

474504

global: cfg.tools?.exec,

@@ -580,7 +610,7 @@ async function evaluateSystemRunPolicyPhase(

580610

? autoReviewSegment?.argv

581611

: undefined;

582612

const canAutoReviewApprovalMiss =

583-

modePolicy.autoReview &&

613+

effectivePolicy.autoReview &&

584614

ask !== "always" &&

585615

analysisOk &&

586616

autoReviewArgv !== undefined &&