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

推荐订阅源

The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
宝玉的分享
宝玉的分享
V
V2EX
Microsoft Azure Blog
Microsoft Azure 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(scripts): resolve Windows tools in kitchen sink walk ...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main

@@ -62,7 +62,11 @@ import {

6262

validateCliArgs,

6363

waitForGatewayReady,

6464

} from "../../scripts/e2e/kitchen-sink-rpc-walk.mjs";

65-

import { resolveWindowsTaskkillPath } from "../../scripts/lib/windows-taskkill.mjs";

65+

import {

66+

resolveWindowsPowerShellPath,

67+

resolveWindowsSystem32Path,

68+

resolveWindowsTaskkillPath,

69+

} from "../../scripts/lib/windows-taskkill.mjs";

6670

import { cleanupTempDirs, makeTempDir } from "../helpers/temp-dir.js";

67716872

const posixIt = process.platform === "win32" ? it.skip : it;

@@ -71,6 +75,14 @@ function expectedTaskkillPath(): string {

7175

return resolveWindowsTaskkillPath();

7276

}

737778+

function expectedWindowsSystem32Path(executableName: string): string {

79+

return resolveWindowsSystem32Path(executableName);

80+

}

81+82+

function expectedPowerShellPath(): string {

83+

return resolveWindowsPowerShellPath();

84+

}

85+7486

afterEach(() => {

7587

vi.restoreAllMocks();

7688

vi.useRealTimers();

@@ -1694,6 +1706,15 @@ describe("kitchen-sink RPC health/status assertions", () => {

16941706

});

1695170716961708

describe("kitchen-sink RPC process sampling", () => {

1709+

it("rejects unsafe Windows System32 executable names", () => {

1710+

expect(() => resolveWindowsSystem32Path("..\\netstat.exe")).toThrow(

1711+

/Invalid Windows System32 executable name/u,

1712+

);

1713+

expect(() => resolveWindowsSystem32Path("netstat")).toThrow(

1714+

/Invalid Windows System32 executable name/u,

1715+

);

1716+

});

1717+16971718

it("samples RSS on Windows instead of silently disabling the resource guard", async () => {

16981719

const calls: Array<{ command: string; args: string[] }> = [];

16991720

const sample = await sampleProcess(1234, {

@@ -1711,7 +1732,7 @@ describe("kitchen-sink RPC process sampling", () => {

17111732

processId: 5678,

17121733

rssMiB: 256,

17131734

});

1714-

expect(calls[0]?.command).toBe("powershell.exe");

1735+

expect(calls[0]?.command).toBe(expectedPowerShellPath());

17151736

expect(calls[0]?.args.join(" ")).toContain("$rootPid = 1234");

17161737

expect(calls[0]?.args.join(" ")).toContain("ParentProcessId");

17171738

});

@@ -1743,22 +1764,18 @@ describe("kitchen-sink RPC process sampling", () => {

17431764

expect(command).toContain("Sort-Object WorkingSet64 -Descending");

17441765

});

174517661746-

it("falls back to the legacy powershell command name on Windows", async () => {

1767+

it("does not fall back to a PATH-resolved powershell command on Windows", async () => {

17471768

const commands: string[] = [];

17481769

const sample = await sampleProcess(1234, {

17491770

platform: "win32",

17501771

runCommand: async (command: string) => {

17511772

commands.push(command);

1752-

if (command === "powershell.exe") {

1753-

throw new Error("missing powershell.exe");

1754-

}

1755-

return { stdout: `${96 * 1024 * 1024} 0 1234`, stderr: "" };

1773+

throw new Error("trusted powershell unavailable");

17561774

},

17571775

});

175817761759-

expect(commands).toEqual(["powershell.exe", "powershell"]);

1760-

expect(sample?.rssMiB).toBe(96);

1761-

expect(sample?.aggregateRssMiB).toBe(96);

1777+

expect(commands).toEqual([expectedPowerShellPath()]);

1778+

expect(sample).toBeNull();

17621779

});

1763178017641781

it("does not truncate malformed Windows PowerShell CPU or id samples", async () => {

@@ -1841,7 +1858,7 @@ describe("kitchen-sink RPC process sampling", () => {

18411858

const sample = await sampleWindowsProcessByPort(19675, {

18421859

runCommand: async (command: string, args: string[]) => {

18431860

calls.push({ command, args });

1844-

if (command === "netstat.exe") {

1861+

if (command === expectedWindowsSystem32Path("netstat.exe")) {

18451862

return {

18461863

stdout: [

18471864

" Proto Local Address Foreign Address State PID",

@@ -1852,7 +1869,7 @@ describe("kitchen-sink RPC process sampling", () => {

18521869

stderr: "",

18531870

};

18541871

}

1855-

if (command === "powershell.exe") {

1872+

if (command === expectedPowerShellPath()) {

18561873

return { stdout: `${384 * 1024 * 1024} 2.25 6789 ${512 * 1024 * 1024}`, stderr: "" };

18571874

}

18581875

throw new Error(`unexpected command ${command}`);

@@ -1867,9 +1884,9 @@ describe("kitchen-sink RPC process sampling", () => {

18671884

rssMiB: 384,

18681885

});

18691886

expect(calls).toEqual([

1870-

{ command: "netstat.exe", args: ["-ano", "-p", "tcp"] },

1887+

{ command: expectedWindowsSystem32Path("netstat.exe"), args: ["-ano", "-p", "tcp"] },

18711888

{

1872-

command: "powershell.exe",

1889+

command: expectedPowerShellPath(),

18731890

args: expect.arrayContaining(["-Command", expect.stringContaining("$rootPid = 6789")]),

18741891

},

18751892

]);

@@ -1880,7 +1897,7 @@ describe("kitchen-sink RPC process sampling", () => {

18801897

const sample = await sampleWindowsProcessByPort(19675, {

18811898

runCommand: async (command: string) => {

18821899

calls.push(command);

1883-

if (command === "netstat.exe") {

1900+

if (command === expectedWindowsSystem32Path("netstat.exe")) {

18841901

return {

18851902

stdout: [

18861903

" Proto Local Address Foreign Address State PID",

@@ -1889,10 +1906,10 @@ describe("kitchen-sink RPC process sampling", () => {

18891906

stderr: "",

18901907

};

18911908

}

1892-

if (command === "powershell.exe" || command === "powershell") {

1909+

if (command === expectedPowerShellPath()) {

18931910

throw new Error("powershell unavailable");

18941911

}

1895-

if (command === "tasklist.exe") {

1912+

if (command === expectedWindowsSystem32Path("tasklist.exe")) {

18961913

return {

18971914

stdout: '"node.exe","6789","Console","1","262,144 K"',

18981915

stderr: "",

@@ -1908,13 +1925,17 @@ describe("kitchen-sink RPC process sampling", () => {

19081925

processId: 6789,

19091926

rssMiB: 256,

19101927

});

1911-

expect(calls).toEqual(["netstat.exe", "powershell.exe", "powershell", "tasklist.exe"]);

1928+

expect(calls).toEqual([

1929+

expectedWindowsSystem32Path("netstat.exe"),

1930+

expectedPowerShellPath(),

1931+

expectedWindowsSystem32Path("tasklist.exe"),

1932+

]);

19121933

});

1913193419141935

it("falls back to the known Windows pid when tasklist reports malformed pid text", async () => {

19151936

const sample = await sampleWindowsProcessByPort(19675, {

19161937

runCommand: async (command: string) => {

1917-

if (command === "netstat.exe") {

1938+

if (command === expectedWindowsSystem32Path("netstat.exe")) {

19181939

return {

19191940

stdout: [

19201941

" Proto Local Address Foreign Address State PID",

@@ -1923,10 +1944,10 @@ describe("kitchen-sink RPC process sampling", () => {

19231944

stderr: "",

19241945

};

19251946

}

1926-

if (command === "powershell.exe" || command === "powershell") {

1947+

if (command === expectedPowerShellPath()) {

19271948

throw new Error("powershell unavailable");

19281949

}

1929-

if (command === "tasklist.exe") {

1950+

if (command === expectedWindowsSystem32Path("tasklist.exe")) {

19301951

return {

19311952

stdout: '"node.exe","9999x","Console","1","262,144 K"',

19321953

stderr: "",

@@ -1947,7 +1968,7 @@ describe("kitchen-sink RPC process sampling", () => {

19471968

it("rejects malformed tasklist RSS instead of stripping digits", async () => {

19481969

const sample = await sampleWindowsProcessByPort(19675, {

19491970

runCommand: async (command: string) => {

1950-

if (command === "netstat.exe") {

1971+

if (command === expectedWindowsSystem32Path("netstat.exe")) {

19511972

return {

19521973

stdout: [

19531974

" Proto Local Address Foreign Address State PID",

@@ -1956,10 +1977,10 @@ describe("kitchen-sink RPC process sampling", () => {

19561977

stderr: "",

19571978

};

19581979

}

1959-

if (command === "powershell.exe" || command === "powershell") {

1980+

if (command === expectedPowerShellPath()) {

19601981

throw new Error("powershell unavailable");

19611982

}

1962-

if (command === "tasklist.exe") {

1983+

if (command === expectedWindowsSystem32Path("tasklist.exe")) {

19631984

return {

19641985

stdout: '"node.exe","6789","Console","1","262x144 K"',

19651986

stderr: "",