Skip to content

Commit 53ce1e6

Browse files
tayounvincentkoc
authored andcommitted
fix(launchd): support dotted profile updater labels
1 parent 6b94f42 commit 53ce1e6

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/daemon/launchd.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,18 @@ describe("launchctl list detection", () => {
470470
"- 127 ai.openclaw.update.2026.5.12",
471471
"- 0 ai.openclaw.manual-update.1717168800",
472472
"- 0 ai.openclaw.tayoun.update.20260625T201026-0400",
473+
"- 0 ai.openclaw.dev.team.update.20260625T201026-0400",
473474
"8142 0 ai.openclaw.update.2026.5.13-beta.1",
474475
"- 0 ai.openclaw.manual-updater.1717168800",
475476
"- 0 com.example.other",
476477
].join("\n"),
477478
);
478479

479480
expect(jobs).toEqual([
481+
{
482+
label: "ai.openclaw.dev.team.update.20260625T201026-0400",
483+
lastExitStatus: 0,
484+
},
480485
{
481486
label: "ai.openclaw.manual-update.1717168800",
482487
lastExitStatus: 0,
@@ -503,11 +508,16 @@ describe("launchctl list detection", () => {
503508
state.listOutput = [
504509
"- 127 ai.openclaw.update.2026.5.12",
505510
"- 0 ai.openclaw.tayoun.update.20260625T201026-0400",
511+
"- 0 ai.openclaw.dev.team.update.20260625T201026-0400",
506512
].join("\n");
507513

508514
const jobs = await findStaleOpenClawUpdateLaunchdJobs();
509515

510516
expect(jobs).toEqual([
517+
{
518+
label: "ai.openclaw.dev.team.update.20260625T201026-0400",
519+
lastExitStatus: 0,
520+
},
511521
{
512522
label: "ai.openclaw.tayoun.update.20260625T201026-0400",
513523
lastExitStatus: 0,
@@ -586,14 +596,14 @@ describe("launchctl list detection", () => {
586596
async () => {
587597
await expect(
588598
disableCurrentOpenClawUpdateLaunchdJob({
589-
LAUNCH_JOB_LABEL: "ai.openclaw.tayoun.update.20260625T201026-0400",
599+
LAUNCH_JOB_LABEL: "ai.openclaw.dev.team.update.20260625T201026-0400",
590600
}),
591601
).resolves.toBe(true);
592602

593603
const domain = typeof process.getuid === "function" ? `gui/${process.getuid()}` : "gui/501";
594604
expect(state.launchctlCalls).toContainEqual([
595605
"disable",
596-
`${domain}/ai.openclaw.tayoun.update.20260625T201026-0400`,
606+
`${domain}/ai.openclaw.dev.team.update.20260625T201026-0400`,
597607
]);
598608
expect(launchctlCommandNames()).not.toContain("remove");
599609
},
@@ -734,13 +744,13 @@ describe("launchctl list detection", () => {
734744
"disables explicit profile-scoped updater jobs",
735745
async () => {
736746
await expect(
737-
disableOpenClawUpdateLaunchdJob("ai.openclaw.tayoun.update.20260625T201026-0400"),
747+
disableOpenClawUpdateLaunchdJob("ai.openclaw.dev.team.update.20260625T201026-0400"),
738748
).resolves.toBe(true);
739749

740750
const domain = typeof process.getuid === "function" ? `gui/${process.getuid()}` : "gui/501";
741751
expect(state.launchctlCalls).toContainEqual([
742752
"disable",
743-
`${domain}/ai.openclaw.tayoun.update.20260625T201026-0400`,
753+
`${domain}/ai.openclaw.dev.team.update.20260625T201026-0400`,
744754
]);
745755
},
746756
);

src/daemon/launchd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const LAUNCH_AGENT_STDERR_PATH = "/dev/null";
5252
const OPENCLAW_UPDATE_LAUNCHD_LABEL_PREFIX = "ai.openclaw.update.";
5353
const OPENCLAW_MANUAL_UPDATE_LAUNCHD_LABEL_PATTERN = /^ai\.openclaw\.manual-update\.\d+$/;
5454
const OPENCLAW_PROFILE_UPDATE_LAUNCHD_LABEL_PATTERN =
55-
/^ai\.openclaw\.[A-Za-z0-9_-]+\.update\.[A-Za-z0-9._-]+$/;
55+
/^ai\.openclaw\.[A-Za-z0-9._-]+\.update\.[A-Za-z0-9._-]+$/;
5656
const LAUNCH_AGENT_STOP_PORT_RELEASE_TIMEOUT_MS = LAUNCH_AGENT_EXIT_TIMEOUT_SECONDS * 1_000;
5757
const LAUNCH_AGENT_STOP_PORT_RELEASE_POLL_MS = 100;
5858

0 commit comments

Comments
 (0)