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

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
F
Full Disclosure
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
H
Hacker News: Front Page
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
B
Blog RSS Feed
H
Heimdal Security Blog
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
V2EX - 技术
V2EX - 技术
V
Vulnerabilities – Threatpost
Help Net Security
Help Net Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
W
WeLiveSecurity
T
Tenable Blog
D
DataBreaches.Net
Martin Fowler
Martin Fowler
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
S
Secure Thoughts
O
OpenAI News
L
LINUX DO - 热门话题
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
J
Java Code Geeks
Know Your Adversary
Know Your Adversary
IT之家
IT之家
Latest news
Latest news
Cloudbric
Cloudbric

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: trim boundary and fixture hotspots · openclaw/openclaw@38923d1
steipete · 2026-04-18 · via Recent Commits to openclaw:main

@@ -167,20 +167,16 @@ function expectShellPayloadApprovalDenied(params: {

167167

if (process.platform === "win32") {

168168

return;

169169

}

170-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), params.tmpPrefix));

171-

try {

172-

const scriptPath = path.join(tmp, params.fileName);

173-

fs.writeFileSync(scriptPath, params.body);

174-

fs.chmodSync(scriptPath, 0o755);

175-

const prepared = buildSystemRunApprovalPlan({

176-

command: ["/bin/sh", "-lc", scriptPath],

177-

rawCommand: scriptPath,

178-

cwd: tmp,

179-

});

180-

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

181-

} finally {

182-

fs.rmSync(tmp, { recursive: true, force: true });

183-

}

170+

const tmp = createFixtureDir(params.tmpPrefix);

171+

const scriptPath = path.join(tmp, params.fileName);

172+

fs.writeFileSync(scriptPath, params.body);

173+

fs.chmodSync(scriptPath, 0o755);

174+

const prepared = buildSystemRunApprovalPlan({

175+

command: ["/bin/sh", "-lc", scriptPath],

176+

rawCommand: scriptPath,

177+

cwd: tmp,

178+

});

179+

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

184180

}

185181186182

function expectMutableFileOperandApprovalPlan(fixture: ScriptOperandFixture, cwd: string) {

@@ -478,7 +474,7 @@ describe("hardenApprovedExecutionPaths", () => {

478474

];

479475480476

it.runIf(process.platform !== "win32").each(cases)("$name", (testCase) => {

481-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-approval-hardening-"));

477+

const tmp = createFixtureDir("openclaw-approval-hardening-");

482478

const oldPath = process.env.PATH;

483479

let pathToken: PathTokenSetup | null = null;

484480

if (testCase.withPathToken) {

@@ -534,7 +530,6 @@ describe("hardenApprovedExecutionPaths", () => {

534530

process.env.PATH = oldPath;

535531

}

536532

}

537-

fs.rmSync(tmp, { recursive: true, force: true });

538533

}

539534

});

540535

@@ -847,49 +842,41 @@ describe("hardenApprovedExecutionPaths", () => {

847842

if (process.platform === "win32") {

848843

return;

849844

}

850-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-relative-binary-binding-"));

851-

try {

852-

const binaryPath = resolveNativeBinaryFixturePath();

853-

const relativeBinaryPath = path.join(tmp, "tool");

854-

fs.copyFileSync(binaryPath, relativeBinaryPath);

855-

fs.chmodSync(relativeBinaryPath, 0o755);

856-

const prepared = buildSystemRunApprovalPlan({

857-

command: ["/bin/sh", "-lc", "./tool"],

858-

rawCommand: "./tool",

859-

cwd: tmp,

860-

});

861-

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

862-

} finally {

863-

fs.rmSync(tmp, { recursive: true, force: true });

864-

}

845+

const tmp = createFixtureDir("openclaw-shell-relative-binary-binding-");

846+

const binaryPath = resolveNativeBinaryFixturePath();

847+

const relativeBinaryPath = path.join(tmp, "tool");

848+

fs.copyFileSync(binaryPath, relativeBinaryPath);

849+

fs.chmodSync(relativeBinaryPath, 0o755);

850+

const prepared = buildSystemRunApprovalPlan({

851+

command: ["/bin/sh", "-lc", "./tool"],

852+

rawCommand: "./tool",

853+

cwd: tmp,

854+

});

855+

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

865856

});

866857867858

it("keeps fail-closed behavior for writable absolute native-binary shell payloads", () => {

868859

if (process.platform === "win32") {

869860

return;

870861

}

871-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-absolute-binary-binding-"));

872-

try {

873-

const binaryPath = resolveNativeBinaryFixturePath();

874-

const copiedBinaryPath = path.join(tmp, "tool");

875-

fs.copyFileSync(binaryPath, copiedBinaryPath);

876-

fs.chmodSync(copiedBinaryPath, 0o755);

877-

const prepared = buildSystemRunApprovalPlan({

878-

command: ["/bin/sh", "-lc", copiedBinaryPath],

879-

rawCommand: copiedBinaryPath,

880-

cwd: tmp,

881-

});

882-

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

883-

} finally {

884-

fs.rmSync(tmp, { recursive: true, force: true });

885-

}

862+

const tmp = createFixtureDir("openclaw-shell-absolute-binary-binding-");

863+

const binaryPath = resolveNativeBinaryFixturePath();

864+

const copiedBinaryPath = path.join(tmp, "tool");

865+

fs.copyFileSync(binaryPath, copiedBinaryPath);

866+

fs.chmodSync(copiedBinaryPath, 0o755);

867+

const prepared = buildSystemRunApprovalPlan({

868+

command: ["/bin/sh", "-lc", copiedBinaryPath],

869+

rawCommand: copiedBinaryPath,

870+

cwd: tmp,

871+

});

872+

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

886873

});

887874888875

it("keeps fail-closed behavior for owner-controlled read-only absolute binaries", () => {

889876

if (process.platform === "win32") {

890877

return;

891878

}

892-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-owned-readonly-binding-"));

879+

const tmp = createFixtureDir("openclaw-shell-owned-readonly-binding-");

893880

const binaryPath = path.join(tmp, "tool");

894881

try {

895882

fs.copyFileSync(resolveNativeBinaryFixturePath(), binaryPath);

@@ -903,15 +890,14 @@ describe("hardenApprovedExecutionPaths", () => {

903890

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

904891

} finally {

905892

fs.chmodSync(tmp, 0o755);

906-

fs.rmSync(tmp, { recursive: true, force: true });

907893

}

908894

});

909895910896

it("keeps fail-closed behavior for symlinked binaries with writable targets", () => {

911897

if (process.platform === "win32") {

912898

return;

913899

}

914-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-symlink-binary-binding-"));

900+

const tmp = createFixtureDir("openclaw-shell-symlink-binary-binding-");

915901

const stableDir = path.join(tmp, "stable");

916902

const mutableDir = path.join(tmp, "mutable");

917903

try {

@@ -932,7 +918,6 @@ describe("hardenApprovedExecutionPaths", () => {

932918

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

933919

} finally {

934920

fs.chmodSync(stableDir, 0o755);

935-

fs.rmSync(tmp, { recursive: true, force: true });

936921

}

937922

});

938923

@@ -972,49 +957,41 @@ describe("hardenApprovedExecutionPaths", () => {

972957

if (process.platform === "win32") {

973958

return;

974959

}

975-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-race-binding-"));

976-

try {

977-

const scriptPath = path.join(tmp, "run.sh");

978-

fs.writeFileSync(scriptPath, "#!/bin/sh\necho SAFE\n");

979-

fs.chmodSync(scriptPath, 0o755);

980-

const realStatSync = fs.statSync;

981-

let targetStatCalls = 0;

982-

const statSyncSpy = vi.spyOn(fs, "statSync").mockImplementation((pathLike, options) => {

983-

const targetPath = typeof pathLike === "string" ? pathLike : pathLike.toString();

984-

if (targetPath === scriptPath) {

985-

targetStatCalls += 1;

986-

if (targetStatCalls === 2) {

987-

return realStatSync(tmp, options);

988-

}

960+

const tmp = createFixtureDir("openclaw-shell-race-binding-");

961+

const scriptPath = path.join(tmp, "run.sh");

962+

fs.writeFileSync(scriptPath, "#!/bin/sh\necho SAFE\n");

963+

fs.chmodSync(scriptPath, 0o755);

964+

const realStatSync = fs.statSync;

965+

let targetStatCalls = 0;

966+

const statSyncSpy = vi.spyOn(fs, "statSync").mockImplementation((pathLike, options) => {

967+

const targetPath = typeof pathLike === "string" ? pathLike : pathLike.toString();

968+

if (targetPath === scriptPath) {

969+

targetStatCalls += 1;

970+

if (targetStatCalls === 2) {

971+

return realStatSync(tmp, options);

989972

}

990-

return realStatSync(pathLike, options);

991-

});

992-

try {

993-

const prepared = buildSystemRunApprovalPlan({

994-

command: ["/bin/sh", "-lc", scriptPath],

995-

rawCommand: scriptPath,

996-

cwd: tmp,

997-

});

998-

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

999-

} finally {

1000-

statSyncSpy.mockRestore();

1001973

}

974+

return realStatSync(pathLike, options);

975+

});

976+

try {

977+

const prepared = buildSystemRunApprovalPlan({

978+

command: ["/bin/sh", "-lc", scriptPath],

979+

rawCommand: scriptPath,

980+

cwd: tmp,

981+

});

982+

expect(prepared).toEqual(DENIED_RUNTIME_APPROVAL);

1002983

} finally {

1003-

fs.rmSync(tmp, { recursive: true, force: true });

984+

statSyncSpy.mockRestore();

1004985

}

1005986

});

10069871007988

it.each(unsafeRuntimeInvocationCases)("$name", (testCase) => {

1008989

withFakeRuntimeBin({

1009990

binName: testCase.binName,

1010991

run: () => {

1011-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), testCase.tmpPrefix));

1012-

try {

1013-

testCase.setup?.(tmp);

1014-

expectRuntimeApprovalDenied(testCase.command, tmp);

1015-

} finally {

1016-

fs.rmSync(tmp, { recursive: true, force: true });

1017-

}

992+

const tmp = createFixtureDir(testCase.tmpPrefix);

993+

testCase.setup?.(tmp);

994+

expectRuntimeApprovalDenied(testCase.command, tmp);

1018995

},

1019996

});

1020997

});

@@ -1062,19 +1039,15 @@ describe("hardenApprovedExecutionPaths", () => {

10621039

withFakeRuntimeBins({

10631040

binNames: ["pnpm", "tsx"],

10641041

run: () => {

1065-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pnpm-dlx-shell-mode-"));

1066-

try {

1067-

fs.writeFileSync(path.join(tmp, "run.ts"), 'console.log("SAFE");\n');

1068-

expect(

1069-

resolveMutableFileOperandSnapshotSync({

1070-

argv: ["pnpm", "dlx", "--shell-mode", "tsx ./run.ts"],

1071-

cwd: tmp,

1072-

shellCommand: null,

1073-

}),

1074-

).toEqual({ ok: true, snapshot: null });

1075-

} finally {

1076-

fs.rmSync(tmp, { recursive: true, force: true });

1077-

}

1042+

const tmp = createFixtureDir("openclaw-pnpm-dlx-shell-mode-");

1043+

fs.writeFileSync(path.join(tmp, "run.ts"), 'console.log("SAFE");\n');

1044+

expect(

1045+

resolveMutableFileOperandSnapshotSync({

1046+

argv: ["pnpm", "dlx", "--shell-mode", "tsx ./run.ts"],

1047+

cwd: tmp,

1048+

shellCommand: null,

1049+

}),

1050+

).toEqual({ ok: true, snapshot: null });

10781051

},

10791052

});

10801053

});

@@ -1083,12 +1056,8 @@ describe("hardenApprovedExecutionPaths", () => {

10831056

withFakeRuntimeBin({

10841057

binName: "pnpm",

10851058

run: () => {

1086-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pnpm-dlx-package-bin-"));

1087-

try {

1088-

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "hello"], tmp);

1089-

} finally {

1090-

fs.rmSync(tmp, { recursive: true, force: true });

1091-

}

1059+

const tmp = createFixtureDir("openclaw-pnpm-dlx-package-bin-");

1060+

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "hello"], tmp);

10921061

},

10931062

});

10941063

});

@@ -1097,14 +1066,8 @@ describe("hardenApprovedExecutionPaths", () => {

10971066

withFakeRuntimeBin({

10981067

binName: "pnpm",

10991068

run: () => {

1100-

const tmp = fs.mkdtempSync(

1101-

path.join(os.tmpdir(), "openclaw-pnpm-dlx-package-runtime-token-"),

1102-

);

1103-

try {

1104-

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "node"], tmp);

1105-

} finally {

1106-

fs.rmSync(tmp, { recursive: true, force: true });

1107-

}

1069+

const tmp = createFixtureDir("openclaw-pnpm-dlx-package-runtime-token-");

1070+

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "node"], tmp);

11081071

},

11091072

});

11101073

});

@@ -1113,14 +1076,8 @@ describe("hardenApprovedExecutionPaths", () => {

11131076

withFakeRuntimeBin({

11141077

binName: "pnpm",

11151078

run: () => {

1116-

const tmp = fs.mkdtempSync(

1117-

path.join(os.tmpdir(), "openclaw-pnpm-dlx-package-runtime-token-multi-"),

1118-

);

1119-

try {

1120-

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "node", "hello"], tmp);

1121-

} finally {

1122-

fs.rmSync(tmp, { recursive: true, force: true });

1123-

}

1079+

const tmp = createFixtureDir("openclaw-pnpm-dlx-package-runtime-token-multi-");

1080+

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "node", "hello"], tmp);

11241081

},

11251082

});

11261083

});

@@ -1129,14 +1086,10 @@ describe("hardenApprovedExecutionPaths", () => {

11291086

withFakeRuntimeBins({

11301087

binNames: ["pnpm", "eslint"],

11311088

run: () => {

1132-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pnpm-dlx-package-file-"));

1133-

try {

1134-

fs.mkdirSync(path.join(tmp, "src"), { recursive: true });

1135-

fs.writeFileSync(path.join(tmp, "src", "index.ts"), 'console.log("SAFE");\n');

1136-

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "eslint", "src/index.ts"], tmp);

1137-

} finally {

1138-

fs.rmSync(tmp, { recursive: true, force: true });

1139-

}

1089+

const tmp = createFixtureDir("openclaw-pnpm-dlx-package-file-");

1090+

fs.mkdirSync(path.join(tmp, "src"), { recursive: true });

1091+

fs.writeFileSync(path.join(tmp, "src", "index.ts"), 'console.log("SAFE");\n');

1092+

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "eslint", "src/index.ts"], tmp);

11401093

},

11411094

});

11421095

});

@@ -1145,16 +1098,9 @@ describe("hardenApprovedExecutionPaths", () => {

11451098

withFakeRuntimeBin({

11461099

binName: "pnpm",

11471100

run: () => {

1148-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pnpm-dlx-package-data-tail-"));

1149-

try {

1150-

fs.writeFileSync(path.join(tmp, "run.ts"), 'console.log("SAFE");\n');

1151-

expectApprovalPlanWithoutMutableOperand(

1152-

["pnpm", "dlx", "cowsay", "tsx", "./run.ts"],

1153-

tmp,

1154-

);

1155-

} finally {

1156-

fs.rmSync(tmp, { recursive: true, force: true });

1157-

}

1101+

const tmp = createFixtureDir("openclaw-pnpm-dlx-package-data-tail-");

1102+

fs.writeFileSync(path.join(tmp, "run.ts"), 'console.log("SAFE");\n');

1103+

expectApprovalPlanWithoutMutableOperand(["pnpm", "dlx", "cowsay", "tsx", "./run.ts"], tmp);

11581104

},

11591105

});

11601106

});

@@ -1183,26 +1129,22 @@ describe("hardenApprovedExecutionPaths", () => {

11831129

});

1184113011851131

it("captures the real shell script operand after value-taking shell flags", () => {

1186-

const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-shell-option-value-"));

1187-

try {

1188-

const scriptPath = path.join(tmp, "run.sh");

1189-

fs.writeFileSync(scriptPath, "#!/bin/sh\necho SAFE\n");

1190-

fs.writeFileSync(path.join(tmp, "errexit"), "decoy\n");

1191-

const snapshot = resolveMutableFileOperandSnapshotSync({

1192-

argv: ["/bin/bash", "-o", "errexit", "./run.sh"],

1193-

cwd: tmp,

1194-

shellCommand: null,

1195-

});

1196-

expect(snapshot).toEqual({

1197-

ok: true,

1198-

snapshot: {

1199-

argvIndex: 3,

1200-

path: fs.realpathSync(scriptPath),

1201-

sha256: expect.any(String),

1202-

},

1203-

});

1204-

} finally {

1205-

fs.rmSync(tmp, { recursive: true, force: true });

1206-

}

1132+

const tmp = createFixtureDir("openclaw-shell-option-value-");

1133+

const scriptPath = path.join(tmp, "run.sh");

1134+

fs.writeFileSync(scriptPath, "#!/bin/sh\necho SAFE\n");

1135+

fs.writeFileSync(path.join(tmp, "errexit"), "decoy\n");

1136+

const snapshot = resolveMutableFileOperandSnapshotSync({

1137+

argv: ["/bin/bash", "-o", "errexit", "./run.sh"],

1138+

cwd: tmp,

1139+

shellCommand: null,

1140+

});

1141+

expect(snapshot).toEqual({

1142+

ok: true,

1143+

snapshot: {

1144+

argvIndex: 3,

1145+

path: fs.realpathSync(scriptPath),

1146+

sha256: expect.any(String),

1147+

},

1148+

});

12071149

});

12081150

});