Add regression test and CHANGELOG entry

- Add test ensuring launchd path never returns "failed" status
- Add CHANGELOG.md entry documenting the fix with issue/PR references
- Reference ThrottleInterval evolution (#27650#29078 → current 1s)
This commit is contained in:
daymade
2026-03-08 19:33:23 +08:00
committed by Peter Steinberger
parent 03aea082d0
commit f930fcbd3f
2 changed files with 17 additions and 0 deletions

View File

@@ -80,6 +80,22 @@ describe("restartGatewayProcessWithFreshPid", () => {
expectLaunchdSupervisedWithoutKickstart({ launchJobLabel: "ai.openclaw.gateway" });
});
it("launchd supervisor never returns failed regardless of triggerOpenClawRestart outcome", () => {
clearSupervisorHints();
setPlatform("darwin");
process.env.OPENCLAW_LAUNCHD_LABEL = "ai.openclaw.gateway";
// Even if triggerOpenClawRestart *would* fail, launchd path must not call it.
triggerOpenClawRestartMock.mockReturnValue({
ok: false,
method: "launchctl",
detail: "Bootstrap failed: 5: Input/output error",
});
const result = restartGatewayProcessWithFreshPid();
expect(result.mode).toBe("supervised");
expect(result.mode).not.toBe("failed");
expect(triggerOpenClawRestartMock).not.toHaveBeenCalled();
});
it("does not schedule kickstart on non-darwin platforms", () => {
setPlatform("linux");
process.env.INVOCATION_ID = "abc123";