Skip to content

Commit 122b452

Browse files
yarin-magclaude
andcommitted
fix(setup): unload LaunchAgent before reloading to replace stale binary path
launchctl load silently fails if the label is already running. On update, the old LaunchAgent (potentially pointing to a different install path like ~/.marionette/app/) would keep KeepAlive-restarting the old binary instead of the newly installed one. Unload first to ensure the new path takes effect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3c70534 commit 122b452

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/server/src/cli/setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ async function setupLaunchAgent(binaryPath: string, isProxy: boolean): Promise<v
126126
</dict></plist>`;
127127

128128
writeFileSync(plistPath, plist);
129+
// Unload first so an already-loaded agent (e.g. from a previous installation
130+
// path) is replaced rather than silently keeping the old binary alive.
131+
await execAsync(`launchctl unload "${plistPath}"`).catch(() => {});
129132
await execAsync(`launchctl load "${plistPath}"`).catch(() => {});
130133
console.log(`✓ ${isProxy ? "Proxy a" : "A"}uto-start configured (macOS LaunchAgent)`);
131134
}

0 commit comments

Comments
 (0)