mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-24 07:01:49 +00:00
fix: stabilize macos daemon onboarding
This commit is contained in:
@@ -250,7 +250,7 @@ describe("launchd install", () => {
|
||||
};
|
||||
}
|
||||
|
||||
it("enables service before bootstrap (clears persisted disabled state)", async () => {
|
||||
it("enables service before bootstrap without self-restarting the fresh agent", async () => {
|
||||
const env = createDefaultLaunchdEnv();
|
||||
await installLaunchAgent({
|
||||
env,
|
||||
@@ -269,9 +269,13 @@ describe("launchd install", () => {
|
||||
const bootstrapIndex = state.launchctlCalls.findIndex(
|
||||
(c) => c[0] === "bootstrap" && c[1] === domain && c[2] === plistPath,
|
||||
);
|
||||
const installKickstartIndex = state.launchctlCalls.findIndex(
|
||||
(c) => c[0] === "kickstart" && c[2] === serviceId,
|
||||
);
|
||||
expect(enableIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(bootstrapIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(enableIndex).toBeLessThan(bootstrapIndex);
|
||||
expect(installKickstartIndex).toBe(-1);
|
||||
});
|
||||
|
||||
it("writes TMPDIR to LaunchAgent environment when provided", async () => {
|
||||
|
||||
@@ -431,7 +431,9 @@ export async function installLaunchAgent({
|
||||
}
|
||||
throw new Error(`launchctl bootstrap failed: ${detail}`);
|
||||
}
|
||||
await execLaunchctl(["kickstart", "-k", `${domain}/${label}`]);
|
||||
// `bootstrap` already loads RunAtLoad agents. Avoid `kickstart -k` here:
|
||||
// on slow macOS guests it SIGTERMs the freshly booted gateway and pushes the
|
||||
// real listener startup past onboarding's health deadline.
|
||||
|
||||
// Ensure we don't end up writing to a clack spinner line (wizards show progress without a newline).
|
||||
writeFormattedLines(
|
||||
|
||||
Reference in New Issue
Block a user