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,8 +2,8 @@ import fs from "node:fs/promises";
import path from "node:path";
import type { GatewayServiceRuntime } from "./service-runtime.js";
import {
formatGatewayServiceDescription,
GATEWAY_LAUNCH_AGENT_LABEL,
resolveGatewayServiceDescription,
resolveGatewayLaunchAgentLabel,
resolveLegacyGatewayLaunchAgentLabels,
} from "./constants.js";
@@ -384,12 +384,7 @@ export async function installLaunchAgent({
const plistPath = resolveLaunchAgentPlistPathForLabel(env, label);
await fs.mkdir(path.dirname(plistPath), { recursive: true });
const serviceDescription =
description ??
formatGatewayServiceDescription({
profile: env.OPENCLAW_PROFILE,
version: environment?.OPENCLAW_SERVICE_VERSION ?? env.OPENCLAW_SERVICE_VERSION,
});
const serviceDescription = resolveGatewayServiceDescription({ env, environment, description });
const plist = buildLaunchAgentPlist({
label,
comment: serviceDescription,