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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
B
Blog
腾讯CDC
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - Franky
罗磊的独立博客
月光博客
月光博客
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
V
Visual Studio Blog
I
InfoQ
有赞技术团队
有赞技术团队
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale

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(qa-lab): taskkill gateway children on windows · openc...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1004,6 +1004,43 @@ describe("buildQaRuntimeEnv", () => {

10041004

expect([child.exitCode, child.signalCode]).not.toEqual([null, null]);

10051005

});

10061006
1007+

it("force-kills Windows gateway process trees when graceful taskkill fails", () => {

1008+

const platformDescriptor = Object.getOwnPropertyDescriptor(process, "platform");

1009+

Object.defineProperty(process, "platform", { value: "win32", configurable: true });

1010+

try {

1011+

const child = Object.assign(new EventEmitter(), {

1012+

pid: 12345,

1013+

exitCode: null as number | null,

1014+

signalCode: null as string | null,

1015+

kill: vi.fn(),

1016+

});

1017+

const runTaskkill = vi

1018+

.fn()

1019+

.mockReturnValueOnce({ status: 1 })

1020+

.mockReturnValueOnce({ status: 0 });

1021+
1022+

testing.signalQaGatewayChildProcessTree(

1023+

child as unknown as Parameters<typeof testing.signalQaGatewayChildProcessTree>[0],

1024+

"SIGTERM",

1025+

runTaskkill,

1026+

);

1027+
1028+

expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], {

1029+

stdio: "ignore",

1030+

windowsHide: true,

1031+

});

1032+

expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], {

1033+

stdio: "ignore",

1034+

windowsHide: true,

1035+

});

1036+

expect(child.kill).not.toHaveBeenCalled();

1037+

} finally {

1038+

if (platformDescriptor) {

1039+

Object.defineProperty(process, "platform", platformDescriptor);

1040+

}

1041+

}

1042+

});

1043+
10071044

it("does not trust an exited gateway wrapper while its process group is alive", async () => {

10081045

const child = Object.assign(new EventEmitter(), {

10091046

pid: 12346,

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,5 @@

11

// Qa Lab plugin module implements gateway child behavior.

2-

import { spawn, type ChildProcess } from "node:child_process";

2+

import { spawn, spawnSync, type ChildProcess } from "node:child_process";

33

import { randomUUID } from "node:crypto";

44

import { createWriteStream, existsSync, type WriteStream } from "node:fs";

55

import fs from "node:fs/promises";

@@ -361,6 +361,7 @@ export const testing = {

361361

resolveQaRuntimeHostVersion,

362362

createQaGatewayChildLogCollector,

363363

createQaBundledPluginsDir,

364+

signalQaGatewayChildProcessTree,

364365

stopQaGatewayChildProcessTree,

365366

};

366367

@@ -390,12 +391,47 @@ function isQaGatewayChildProcessTreeAlive(child: ChildProcess) {

390391

}

391392

}

392393
393-

function signalQaGatewayChildProcessTree(child: ChildProcess, signal: NodeJS.Signals) {

394+

type QaGatewayTaskkillRunner = typeof spawnSync;

395+
396+

function signalQaGatewayWindowsProcessTree(

397+

pid: number,

398+

signal: NodeJS.Signals,

399+

runTaskkill: QaGatewayTaskkillRunner = spawnSync,

400+

) {

401+

const args = ["/PID", String(pid), "/T"];

402+

if (signal === "SIGKILL") {

403+

args.push("/F");

404+

}

405+

const result = runTaskkill("taskkill", args, {

406+

stdio: "ignore",

407+

windowsHide: true,

408+

});

409+

if (!result.error && result.status === 0) {

410+

return true;

411+

}

412+

if (signal !== "SIGKILL") {

413+

const forceResult = runTaskkill("taskkill", [...args, "/F"], {

414+

stdio: "ignore",

415+

windowsHide: true,

416+

});

417+

return !forceResult.error && forceResult.status === 0;

418+

}

419+

return false;

420+

}

421+
422+

function signalQaGatewayChildProcessTree(

423+

child: ChildProcess,

424+

signal: NodeJS.Signals,

425+

runTaskkill: QaGatewayTaskkillRunner = spawnSync,

426+

) {

394427

if (!child.pid) {

395428

return;

396429

}

397430

try {

398431

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

432+

if (signalQaGatewayWindowsProcessTree(child.pid, signal, runTaskkill)) {

433+

return;

434+

}

399435

child.kill(signal);

400436

return;

401437

}