fix: restart Windows gateway via Scheduled Task (#38825) (#38825)

This commit is contained in:
Ayaan Zaidi
2026-03-07 18:00:38 +05:30
committed by GitHub
parent 26c9796736
commit 05c240fad6
12 changed files with 371 additions and 54 deletions

View File

@@ -278,6 +278,7 @@ describe("buildServiceEnvironment", () => {
expect(env.OPENCLAW_SERVICE_KIND).toBe("gateway");
expect(typeof env.OPENCLAW_SERVICE_VERSION).toBe("string");
expect(env.OPENCLAW_SYSTEMD_UNIT).toBe("openclaw-gateway.service");
expect(env.OPENCLAW_WINDOWS_TASK_NAME).toBe("OpenClaw Gateway");
if (process.platform === "darwin") {
expect(env.OPENCLAW_LAUNCHD_LABEL).toBe("ai.openclaw.gateway");
}
@@ -305,6 +306,7 @@ describe("buildServiceEnvironment", () => {
port: 18789,
});
expect(env.OPENCLAW_SYSTEMD_UNIT).toBe("openclaw-gateway-work.service");
expect(env.OPENCLAW_WINDOWS_TASK_NAME).toBe("OpenClaw Gateway (work)");
if (process.platform === "darwin") {
expect(env.OPENCLAW_LAUNCHD_LABEL).toBe("ai.openclaw.work");
}

View File

@@ -6,6 +6,7 @@ import {
GATEWAY_SERVICE_MARKER,
resolveGatewayLaunchAgentLabel,
resolveGatewaySystemdServiceName,
resolveGatewayWindowsTaskName,
NODE_SERVICE_KIND,
NODE_SERVICE_MARKER,
NODE_WINDOWS_TASK_SCRIPT_NAME,
@@ -262,6 +263,7 @@ export function buildServiceEnvironment(params: {
OPENCLAW_GATEWAY_TOKEN: token,
OPENCLAW_LAUNCHD_LABEL: resolvedLaunchdLabel,
OPENCLAW_SYSTEMD_UNIT: systemdUnit,
OPENCLAW_WINDOWS_TASK_NAME: resolveGatewayWindowsTaskName(profile),
OPENCLAW_SERVICE_MARKER: GATEWAY_SERVICE_MARKER,
OPENCLAW_SERVICE_KIND: GATEWAY_SERVICE_KIND,
OPENCLAW_SERVICE_VERSION: VERSION,