fix(macos): preserve externally owned attach-only gateway (#128134)

This commit is contained in:
Peter Steinberger
2026-08-23 02:00:39 -07:00
committed by GitHub
parent 69ae918783
commit 3cb52f4bb8
2 changed files with 12 additions and 2 deletions
@@ -170,8 +170,8 @@ enum GatewayLaunchAgentManager {
self.logger.info("launchd change skipped (remote mode)")
return nil
}
if enabled, self.isLaunchAgentWriteDisabled() {
self.logger.info("launchd enable skipped (disable marker set)")
if self.isLaunchAgentWriteDisabled() {
self.logger.info("launchd change skipped (disable marker set)")
return nil
}
@@ -187,9 +187,19 @@ struct GatewayLaunchAgentManagerTests {
GatewayLaunchAgentManager.clearTestingDaemonCommandCalls()
let error = GatewayLaunchAgentManager.applyAttachOnlyRuntimeOverride()
let installError = await GatewayLaunchAgentManager.set(
enabled: true,
bundlePath: "/Applications/OpenClaw.app",
port: 18789)
let uninstallError = await GatewayLaunchAgentManager.set(
enabled: false,
bundlePath: "/Applications/OpenClaw.app",
port: 18789)
let kickstartError = await GatewayLaunchAgentManager.kickstart()
#expect(error == nil)
#expect(installError == nil)
#expect(uninstallError == nil)
#expect(kickstartError == nil)
#expect(FileManager().fileExists(atPath: marker.path))
#expect(GatewayLaunchAgentManager.testingDaemonCommandCallsSnapshot().isEmpty)