Skip to content

Commit 03aea08

Browse files
daymadesteipete
authored andcommitted
chore: condense inline comments per code review
Remove redundant rationale from test body (test names already convey it) and trim the production comment to what/consequence/link (mechanism details live in #39760).
1 parent 5f45e76 commit 03aea08

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/infra/process-respawn.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ function expectLaunchdSupervisedWithoutKickstart(params?: { launchJobLabel?: str
5454
process.env.OPENCLAW_LAUNCHD_LABEL = "ai.openclaw.gateway";
5555
const result = restartGatewayProcessWithFreshPid();
5656
expect(result.mode).toBe("supervised");
57-
// launchd path no longer calls triggerOpenClawRestart — it relies on
58-
// KeepAlive=true to restart the service after the caller exits.
5957
expect(triggerOpenClawRestartMock).not.toHaveBeenCalled();
6058
expect(spawnMock).not.toHaveBeenCalled();
6159
}
@@ -74,7 +72,6 @@ describe("restartGatewayProcessWithFreshPid", () => {
7472
process.env.LAUNCH_JOB_LABEL = "ai.openclaw.gateway";
7573
const result = restartGatewayProcessWithFreshPid();
7674
expect(result.mode).toBe("supervised");
77-
// launchd relies on KeepAlive=true — no kickstart call needed.
7875
expect(triggerOpenClawRestartMock).not.toHaveBeenCalled();
7976
expect(spawnMock).not.toHaveBeenCalled();
8077
});

src/infra/process-respawn.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ export function restartGatewayProcessWithFreshPid(): GatewayRespawnResult {
3131
const supervisor = detectRespawnSupervisor(process.env);
3232
if (supervisor) {
3333
// launchd: exit(0) is sufficient — KeepAlive=true restarts the service.
34-
// Calling `kickstart -k` from within the service itself races with
35-
// launchd's async bootout state machine: the spawnSync timeout kills the
36-
// launchctl child, but launchd continues the bootout and eventually
37-
// SIGKILLs this process, leaving the LaunchAgent permanently unloaded.
34+
// Self-issued `kickstart -k` races with launchd's bootout state machine
35+
// and can leave the LaunchAgent permanently unloaded.
3836
// See: https://github.com/openclaw/openclaw/issues/39760
3937
if (supervisor === "schtasks") {
4038
const restart = triggerOpenClawRestart();

0 commit comments

Comments
 (0)