diff --git a/scripts/e2e/parallels/windows-smoke.ts b/scripts/e2e/parallels/windows-smoke.ts index 78b70daca933..6e29d6730a29 100755 --- a/scripts/e2e/parallels/windows-smoke.ts +++ b/scripts/e2e/parallels/windows-smoke.ts @@ -696,11 +696,12 @@ Invoke-OpenClaw update status --json`, } private gatewayAction(action: "restart" | "stop"): Promise { + const forceFlag = action === "stop" ? " --force" : ""; return this.guestPowerShellBackground( `gateway-${action}`, `$ErrorActionPreference = 'Continue' $PSNativeCommandUseErrorActionPreference = $false -Invoke-OpenClaw gateway ${action} +Invoke-OpenClaw gateway ${action}${forceFlag} if ($LASTEXITCODE -ne 0) { throw "gateway ${action} failed with exit code $LASTEXITCODE" }`, 420_000, ); diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index 0082968ec5d6..0c17928c060a 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -306,6 +306,12 @@ describe("Parallels smoke model selection", () => { expect(linux).toContain("rm -rf /root/.openclaw /root/.npm/_cacache"); }); + it("forces the explicit test-owned Windows gateway stop", () => { + const windows = readFileSync(TS_PATHS.windows, "utf8"); + expect(windows).toContain('const forceFlag = action === "stop" ? " --force" : "";'); + expect(windows).toContain("Invoke-OpenClaw gateway ${action}${forceFlag}"); + }); + it("preserves caller arguments when loaded as the Windows controller library", () => { const result = spawnSync( "bash",