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

推荐订阅源

D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
IT之家
IT之家
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research

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(infra): resolve Windows port inspection tools · openc...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main

@@ -3,6 +3,11 @@ import net from "node:net";

33

import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

44

import { stripAnsi } from "../../packages/terminal-core/src/ansi.js";

55

import { mockProcessPlatform } from "../test-utils/vitest-spies.js";

6+

import {

7+

getWindowsPowerShellExePath,

8+

getWindowsSystem32ExePath,

9+

getWindowsWmicExePath,

10+

} from "./windows-install-roots.js";

611712

const runCommandWithTimeoutMock = vi.hoisted(() => vi.fn());

813

@@ -422,7 +427,7 @@ describe("inspectPortUsage on Windows", () => {

422427

setPlatform("win32");

423428

runCommandWithTimeoutMock.mockImplementation(async (argv: string[]) => {

424429

const [command] = argv;

425-

if (command === "netstat") {

430+

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

426431

return {

427432

stdout:

428433

" TCP 127.0.0.1:50123 127.0.0.1:18789 ESTABLISHED 4242\r\n" +

@@ -431,10 +436,10 @@ describe("inspectPortUsage on Windows", () => {

431436

code: 0,

432437

};

433438

}

434-

if (command === "tasklist") {

439+

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

435440

return { stdout: "Image Name: node.exe\r\n", stderr: "", code: 0 };

436441

}

437-

if (command === "powershell") {

442+

if (command === getWindowsPowerShellExePath()) {

438443

return {

439444

stdout:

440445

'"C:\\Program Files\\nodejs\\node.exe" C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules\\openclaw\\dist\\index.js logs --follow\r\n',

@@ -460,17 +465,17 @@ describe("inspectPortUsage on Windows", () => {

460465

setPlatform("win32");

461466

runCommandWithTimeoutMock.mockImplementation(async (argv: string[]) => {

462467

const [command] = argv;

463-

if (command === "netstat") {

468+

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

464469

return {

465470

stdout: " TCP 127.0.0.1:18789 0.0.0.0:0 LISTENING 4242\r\n",

466471

stderr: "",

467472

code: 0,

468473

};

469474

}

470-

if (command === "tasklist") {

475+

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

471476

return { stdout: "Image Name: node.exe\r\n", stderr: "", code: 0 };

472477

}

473-

if (command === "powershell") {

478+

if (command === getWindowsPowerShellExePath()) {

474479

return {

475480

stdout:

476481

'"C:\\Program Files\\nodejs\\node.exe" C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules\\openclaw\\dist\\index.js gateway run\r\n',

@@ -496,7 +501,7 @@ describe("inspectPortUsage on Windows", () => {

496501

setPlatform("win32");

497502

runCommandWithTimeoutMock.mockImplementation(async (argv: string[]) => {

498503

const [command] = argv;

499-

if (command === "netstat") {

504+

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

500505

return {

501506

stdout:

502507

" TCP 127.0.0.1:187890 0.0.0.0:0 LISTENING 9000\r\n" +

@@ -517,20 +522,20 @@ describe("inspectPortUsage on Windows", () => {

517522

setPlatform("win32");

518523

runCommandWithTimeoutMock.mockImplementation(async (argv: string[]) => {

519524

const [command] = argv;

520-

if (command === "netstat") {

525+

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

521526

return {

522527

stdout: " TCP 127.0.0.1:18789 0.0.0.0:0 LISTENING 4242\r\n",

523528

stderr: "",

524529

code: 0,

525530

};

526531

}

527-

if (command === "tasklist") {

532+

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

528533

return { stdout: "Image Name: node.exe\r\n", stderr: "", code: 0 };

529534

}

530-

if (command === "powershell") {

535+

if (command === getWindowsPowerShellExePath()) {

531536

return { stdout: "", stderr: "access denied", code: 1 };

532537

}

533-

if (command === "wmic") {

538+

if (command === getWindowsWmicExePath()) {

534539

return {

535540

stdout: "CommandLine=node.exe C:\\openclaw\\dist\\index.js gateway run\r\n",

536541

stderr: "",

@@ -544,6 +549,6 @@ describe("inspectPortUsage on Windows", () => {

544549545550

expect(result.listeners[0]?.commandLine).toContain("openclaw");

546551

const commandNames = runCommandWithTimeoutMock.mock.calls.map(([argv]) => argv[0]);

547-

expect(commandNames).toContain("wmic");

552+

expect(commandNames).toContain(getWindowsWmicExePath());

548553

});

549554

});