refactor(daemon): share service description resolve

This commit is contained in:
Peter Steinberger
2026-02-16 00:36:43 +00:00
parent 58cf37ceeb
commit 0dbc51aa55
5 changed files with 41 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
import path from "node:path";
import type { GatewayServiceRuntime } from "./service-runtime.js";
import { splitArgsPreservingQuotes } from "./arg-split.js";
import { formatGatewayServiceDescription, resolveGatewayWindowsTaskName } from "./constants.js";
import { resolveGatewayServiceDescription, resolveGatewayWindowsTaskName } from "./constants.js";
import { formatLine } from "./output.js";
import { resolveGatewayStateDir } from "./paths.js";
import { parseKeyValueOutput } from "./runtime-parse.js";
@@ -190,12 +190,7 @@ export async function installScheduledTask({
await assertSchtasksAvailable();
const scriptPath = resolveTaskScriptPath(env);
await fs.mkdir(path.dirname(scriptPath), { recursive: true });
const taskDescription =
description ??
formatGatewayServiceDescription({
profile: env.OPENCLAW_PROFILE,
version: environment?.OPENCLAW_SERVICE_VERSION ?? env.OPENCLAW_SERVICE_VERSION,
});
const taskDescription = resolveGatewayServiceDescription({ env, environment, description });
const script = buildTaskScript({
description: taskDescription,
programArguments,