From abe7ea4373ae1ac75171ee63604119f29bf11732 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Mar 2026 05:20:08 +0000 Subject: [PATCH] fix: accept schtasks Last Result key on Windows (#47844) (thanks @MoerAI) --- CHANGELOG.md | 1 + src/cli/program.smoke.test.ts | 4 +-- src/cli/program.test-mocks.ts | 54 ++++++++++++++++++++--------------- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce45052af01..d8040d79aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ Docs: https://docs.openclaw.ai - Gateway/watch mode: restart on bundled-plugin package and manifest metadata changes, rebuild `dist` for extension source and `tsdown.config.ts` changes, and still ignore extension docs. (#47571) thanks @gumadeiras. - Gateway/watch mode: recreate bundled plugin runtime metadata after clean or stale `dist` states, so `pnpm gateway:watch` no longer fails on missing `dist/extensions/*/openclaw.plugin.json` manifests after a rebuild. Thanks @gumadeiras. - Plugins/context engines: enforce owner-aware context-engine registration on both loader and public SDK paths so plugins cannot spoof privileged ownership, claim the core `legacy` engine id, or overwrite an existing engine id through direct SDK imports. (#47595) Thanks @vincentkoc. +- Windows/gateway status: accept `schtasks` `Last Result` output as an alias for `Last Run Result`, so running scheduled-task installs no longer show `Runtime: unknown`. (#47844) Thanks @MoerAI. ## 2026.3.13 diff --git a/src/cli/program.smoke.test.ts b/src/cli/program.smoke.test.ts index 259dd3b0360..9b8fc6dc454 100644 --- a/src/cli/program.smoke.test.ts +++ b/src/cli/program.smoke.test.ts @@ -4,10 +4,10 @@ import { ensureConfigReady, installBaseProgramMocks, installSmokeProgramMocks, - onboardCommand, runTui, runtime, setupCommand, + setupWizardCommand, } from "./program.test-mocks.js"; installBaseProgramMocks(); @@ -68,6 +68,6 @@ describe("cli program (smoke)", () => { await runProgram(["setup", "--remote-url", "ws://example"]); expect(setupCommand).not.toHaveBeenCalled(); - expect(onboardCommand).toHaveBeenCalledTimes(1); + expect(setupWizardCommand).toHaveBeenCalledTimes(1); }); }); diff --git a/src/cli/program.test-mocks.ts b/src/cli/program.test-mocks.ts index cf71122749f..8f82e71fca5 100644 --- a/src/cli/program.test-mocks.ts +++ b/src/cli/program.test-mocks.ts @@ -2,34 +2,39 @@ import { vi, type Mock } from "vitest"; type AnyMock = Mock<(...args: unknown[]) => unknown>; -const programMocks = vi.hoisted(() => ({ - messageCommand: vi.fn(), - statusCommand: vi.fn(), - configureCommand: vi.fn(), - configureCommandWithSections: vi.fn(), - setupCommand: vi.fn(), - onboardCommand: vi.fn(), - callGateway: vi.fn(), - runChannelLogin: vi.fn(), - runChannelLogout: vi.fn(), - runTui: vi.fn(), - loadAndMaybeMigrateDoctorConfig: vi.fn(), - ensureConfigReady: vi.fn(), - ensurePluginRegistryLoaded: vi.fn(), - runtime: { - log: vi.fn(), - error: vi.fn(), - exit: vi.fn(() => { - throw new Error("exit"); - }), - }, -})); +const programMocks = vi.hoisted(() => { + const setupWizardCommand = vi.fn(); + return { + messageCommand: vi.fn(), + statusCommand: vi.fn(), + configureCommand: vi.fn(), + configureCommandWithSections: vi.fn(), + setupCommand: vi.fn(), + setupWizardCommand, + onboardCommand: setupWizardCommand, + callGateway: vi.fn(), + runChannelLogin: vi.fn(), + runChannelLogout: vi.fn(), + runTui: vi.fn(), + loadAndMaybeMigrateDoctorConfig: vi.fn(), + ensureConfigReady: vi.fn(), + ensurePluginRegistryLoaded: vi.fn(), + runtime: { + log: vi.fn(), + error: vi.fn(), + exit: vi.fn(() => { + throw new Error("exit"); + }), + }, + }; +}); export const messageCommand = programMocks.messageCommand as AnyMock; export const statusCommand = programMocks.statusCommand as AnyMock; export const configureCommand = programMocks.configureCommand as AnyMock; export const configureCommandWithSections = programMocks.configureCommandWithSections as AnyMock; export const setupCommand = programMocks.setupCommand as AnyMock; +export const setupWizardCommand = programMocks.setupWizardCommand as AnyMock; export const onboardCommand = programMocks.onboardCommand as AnyMock; export const callGateway = programMocks.callGateway as AnyMock; export const runChannelLogin = programMocks.runChannelLogin as AnyMock; @@ -71,7 +76,10 @@ vi.mock("../commands/configure.js", () => ({ }, })); vi.mock("../commands/setup.js", () => ({ setupCommand: programMocks.setupCommand })); -vi.mock("../commands/onboard.js", () => ({ onboardCommand: programMocks.onboardCommand })); +vi.mock("../commands/onboard.js", () => ({ + onboardCommand: programMocks.onboardCommand, + setupWizardCommand: programMocks.setupWizardCommand, +})); vi.mock("../runtime.js", () => ({ defaultRuntime: programMocks.runtime })); vi.mock("./channel-auth.js", () => ({ runChannelLogin: programMocks.runChannelLogin,