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

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗

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: harden Windows Parallels update smoke · openclaw/ope...
steipete · 2026-04-30 · via Recent Commits to openclaw:main

@@ -14,6 +14,7 @@ import {

1414

resolveLatestVersion,

1515

resolveProviderAuth,

1616

run,

17+

runStreaming,

1718

say,

1819

startHostServer,

1920

writeJson,

@@ -318,7 +319,7 @@ class NpmUpdateSmoke {

318319

}

319320

}

320321321-

private spawnUpdate(label: string, platform: Platform, fn: () => void): Job {

322+

private spawnUpdate(label: string, platform: Platform, fn: () => Promise<void> | void): Job {

322323

const logPath = path.join(this.runDir, `${platform}-update.log`);

323324

const job: Job = {

324325

done: false,

@@ -343,7 +344,7 @@ class NpmUpdateSmoke {

343344

append(chunk)) as typeof process.stdout.write;

344345

process.stderr.write = ((chunk: string | Uint8Array) =>

345346

append(chunk)) as typeof process.stderr.write;

346-

fn();

347+

await fn();

347348

await writeFile(logPath, log, "utf8");

348349

return 0;

349350

} catch (error) {

@@ -365,8 +366,8 @@ class NpmUpdateSmoke {

365366

this.guestMacos(this.updateScript("macos"), updateTimeoutSeconds * 1000);

366367

}

367368368-

private runWindowsUpdate(): void {

369-

this.guestWindows(this.updateScript("windows"), updateTimeoutSeconds * 1000);

369+

private runWindowsUpdate(): Promise<void> {

370+

return this.guestWindows(this.updateScript("windows"), updateTimeoutSeconds * 1000);

370371

}

371372372373

private runLinuxUpdate(): void {

@@ -452,7 +453,27 @@ class NpmUpdateSmoke {

452453

);

453454

}

454455455-

private guestWindows(script: string, timeoutMs: number): void {

456+

private async guestWindows(script: string, timeoutMs: number): Promise<void> {

457+

const fileBase = `openclaw-parallels-npm-update-windows-${process.pid}-${Date.now()}`;

458+

const pathsScript = `$base = Join-Path $env:TEMP '${fileBase}'

459+

$scriptPath = "$base.ps1"

460+

$logPath = "$base.log"

461+

$donePath = "$base.done"

462+

$exitPath = "$base.exit"`;

463+

const payload = `$ErrorActionPreference = 'Stop'

464+

$PSNativeCommandUseErrorActionPreference = $false

465+

${pathsScript}

466+

try {

467+

& {

468+

${script}

469+

} *>&1 | ForEach-Object { $_ | Out-String | Add-Content -Path $logPath -Encoding UTF8 }

470+

Set-Content -Path $exitPath -Value '0' -Encoding UTF8

471+

} catch {

472+

$_ | Out-String | Add-Content -Path $logPath -Encoding UTF8

473+

Set-Content -Path $exitPath -Value '1' -Encoding UTF8

474+

} finally {

475+

Set-Content -Path $donePath -Value 'done' -Encoding UTF8

476+

}`;

456477

run(

457478

"prlctl",

458479

[

@@ -464,10 +485,107 @@ class NpmUpdateSmoke {

464485

"-ExecutionPolicy",

465486

"Bypass",

466487

"-EncodedCommand",

467-

encodePowerShell(script),

488+

encodePowerShell(`${pathsScript}

489+

Remove-Item -Path $scriptPath, $logPath, $donePath, $exitPath -Force -ErrorAction SilentlyContinue

490+

[System.IO.File]::WriteAllText($scriptPath, [Console]::In.ReadToEnd(), [System.Text.UTF8Encoding]::new($false))

491+

if (!(Test-Path $scriptPath)) { throw "background update script was not written" }`),

468492

],

469-

{ timeoutMs },

493+

{ input: payload, timeoutMs: Math.min(timeoutMs, 120_000) },

470494

);

495+496+

const launchLogPath = path.join(this.runDir, `${fileBase}-launch.log`);

497+

const launchStatus = await runStreaming(

498+

"prlctl",

499+

[

500+

"exec",

501+

windowsVm,

502+

"--current-user",

503+

"cmd.exe",

504+

"/d",

505+

"/s",

506+

"/c",

507+

`start "" /min powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "%TEMP%\\${fileBase}.ps1"`,

508+

],

509+

{ logPath: launchLogPath, quiet: true, timeoutMs: 20_000 },

510+

);

511+

const launchLog = await readFile(launchLogPath, "utf8").catch(() => "");

512+

if (launchLog) {

513+

process.stdout.write(launchLog);

514+

}

515+

if (launchStatus !== 0 && launchStatus !== 124) {

516+

throw new Error(`Windows update background launch failed with exit code ${launchStatus}`);

517+

}

518+519+

const deadline = Date.now() + timeoutMs;

520+

let lastLogOffset = 0;

521+

while (Date.now() < deadline) {

522+

const poll = run(

523+

"prlctl",

524+

[

525+

"exec",

526+

windowsVm,

527+

"--current-user",

528+

"powershell.exe",

529+

"-NoProfile",

530+

"-ExecutionPolicy",

531+

"Bypass",

532+

"-EncodedCommand",

533+

encodePowerShell(`${pathsScript}

534+

$offset = ${lastLogOffset}

535+

if (Test-Path $logPath) {

536+

$bytes = [System.IO.File]::ReadAllBytes($logPath)

537+

if ($bytes.Length -gt $offset) {

538+

"__OPENCLAW_LOG_OFFSET__:$($bytes.Length)"

539+

[System.Text.Encoding]::UTF8.GetString($bytes, $offset, $bytes.Length - $offset)

540+

}

541+

}

542+

if (Test-Path $donePath) {

543+

$backgroundExit = if (Test-Path $exitPath) { (Get-Content -Path $exitPath -Raw).Trim() } else { '0' }

544+

"__OPENCLAW_BACKGROUND_EXIT__:$backgroundExit"

545+

'__OPENCLAW_BACKGROUND_DONE__'

546+

if ($backgroundExit -ne '0') { exit 23 }

547+

exit 0

548+

}`),

549+

],

550+

{ check: false, timeoutMs: Math.min(30_000, Math.max(1_000, deadline - Date.now())) },

551+

);

552+

if (poll.stdout) {

553+

process.stdout.write(poll.stdout);

554+

}

555+

if (poll.stderr) {

556+

process.stderr.write(poll.stderr);

557+

}

558+

const offsetMatch = poll.stdout.match(/__OPENCLAW_LOG_OFFSET__:(\d+)/);

559+

if (offsetMatch) {

560+

lastLogOffset = Number(offsetMatch[1]);

561+

}

562+

if (poll.stdout.includes("__OPENCLAW_BACKGROUND_DONE__")) {

563+

const exitMatch = poll.stdout.match(/__OPENCLAW_BACKGROUND_EXIT__:(\S+)/);

564+

const backgroundExit = exitMatch?.[1] ?? "0";

565+

if (backgroundExit !== "0" || (poll.status !== 0 && poll.status !== 124)) {

566+

throw new Error("Windows update failed");

567+

}

568+

run(

569+

"prlctl",

570+

[

571+

"exec",

572+

windowsVm,

573+

"--current-user",

574+

"powershell.exe",

575+

"-NoProfile",

576+

"-ExecutionPolicy",

577+

"Bypass",

578+

"-EncodedCommand",

579+

encodePowerShell(`${pathsScript}

580+

Remove-Item -Path $scriptPath, $logPath, $donePath, $exitPath -Force -ErrorAction SilentlyContinue`),

581+

],

582+

{ check: false, timeoutMs: 30_000 },

583+

);

584+

return;

585+

}

586+

await new Promise((resolve) => setTimeout(resolve, 5_000));

587+

}

588+

throw new Error(`Windows update timed out after ${updateTimeoutSeconds}s`);

471589

}

472590473591

private guestLinux(script: string, timeoutMs: number): void {