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

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
有赞技术团队
有赞技术团队
美团技术团队
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
I
InfoQ
小众软件
小众软件
MongoDB | Blog
MongoDB | 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): bind node auto-review commands · openclaw/open...
joshavant · 2026-05-29 · via Recent Commits to openclaw:main

@@ -814,6 +814,112 @@ describe("executeNodeHostCommand", () => {

814814

);

815815

});

816816817+

it("requests human approval when node auto-review cannot bind a single parsed command", async () => {

818+

const autoReviewer = vi.fn<ExecAutoReviewer>(async () => ({

819+

decision: "allow-once",

820+

risk: "low",

821+

rationale: "test reviewer would allow it",

822+

}));

823+

evaluateShellAllowlistMock.mockReturnValue({

824+

allowlistMatches: [],

825+

analysisOk: true,

826+

allowlistSatisfied: false,

827+

segments: [

828+

{ raw: "echo ok", resolution: null, argv: ["echo", "ok"] },

829+

{ raw: "pwd", resolution: null, argv: ["pwd"] },

830+

],

831+

segmentAllowlistEntries: [],

832+

});

833+

resolveExecHostApprovalContextMock.mockReturnValue({

834+

approvals: { allowlist: [], file: { version: 1, agents: {} } },

835+

hostSecurity: "allowlist",

836+

hostAsk: "on-miss",

837+

askFallback: "deny",

838+

});

839+840+

const result = await executeNodeHostCommand({

841+

command: "echo ok; pwd",

842+

workdir: "/tmp/work",

843+

env: {},

844+

security: "allowlist",

845+

ask: "on-miss",

846+

autoReview: true,

847+

autoReviewer,

848+

defaultTimeoutSec: 30,

849+

approvalRunningNoticeMs: 0,

850+

warnings: [],

851+

agentId: "requested-agent",

852+

sessionKey: "requested-session",

853+

});

854+855+

expect(result.details?.status).toBe("approval-pending");

856+

expect(autoReviewer).not.toHaveBeenCalled();

857+

expect(createAndRegisterDefaultExecApprovalRequestMock).toHaveBeenCalledTimes(1);

858+

});

859+860+

it("does not use fallback-full when node auto-review cannot parse the command", async () => {

861+

const autoReviewer = vi.fn<ExecAutoReviewer>(async () => ({

862+

decision: "allow-once",

863+

risk: "low",

864+

rationale: "test reviewer would allow it",

865+

}));

866+

evaluateShellAllowlistMock.mockReturnValue({

867+

allowlistMatches: [],

868+

analysisOk: false,

869+

allowlistSatisfied: false,

870+

segments: [],

871+

segmentAllowlistEntries: [],

872+

});

873+

resolveExecHostApprovalContextMock.mockReturnValue({

874+

approvals: { allowlist: [], file: { version: 1, agents: {} } },

875+

hostSecurity: "allowlist",

876+

hostAsk: "on-miss",

877+

askFallback: "full",

878+

});

879+

resolveApprovalDecisionOrUndefinedMock.mockResolvedValue(null);

880+

createExecApprovalDecisionStateMock.mockReturnValue({

881+

baseDecision: { timedOut: true },

882+

approvedByAsk: true,

883+

deniedReason: null,

884+

});

885+

enforceStrictInlineEvalApprovalBoundaryMock.mockImplementation((value) =>

886+

value.requiresAutoReviewHumanApproval === true && value.baseDecision.timedOut

887+

? { approvedByAsk: false, deniedReason: "approval-timeout" }

888+

: { approvedByAsk: value.approvedByAsk, deniedReason: value.deniedReason },

889+

);

890+891+

const result = await executeNodeHostCommand({

892+

command: "echo 'unterminated",

893+

workdir: "/tmp/work",

894+

env: {},

895+

security: "allowlist",

896+

ask: "on-miss",

897+

autoReview: true,

898+

autoReviewer,

899+

defaultTimeoutSec: 30,

900+

approvalRunningNoticeMs: 0,

901+

warnings: [],

902+

agentId: "requested-agent",

903+

sessionKey: "requested-session",

904+

});

905+906+

expect(result.details?.status).toBe("approval-pending");

907+

expect(autoReviewer).not.toHaveBeenCalled();

908+

await vi.waitFor(() => {

909+

expect(sendExecApprovalFollowupResultMock).toHaveBeenCalledWith(

910+

{ approvalId: "approval-1" },

911+

"Exec denied (node=node-1 id=approval-1, approval-timeout): echo 'unterminated",

912+

);

913+

});

914+

expect(

915+

callGatewayToolMock.mock.calls.some(

916+

([method, , params]) =>

917+

method === "node.invoke" &&

918+

(params as MockNodeInvokeParams | undefined)?.command === "system.run",

919+

),

920+

).toBe(false);

921+

});

922+817923

it("does not use fallback-full when node auto-review asks for human approval", async () => {

818924

const autoReviewer = vi.fn<ExecAutoReviewer>(async () => ({

819925

decision: "ask",