Merge pull request #982 from wes-davis/fix/gateway-connection-diagnostics

macOS: keep gateway connected (stop port flapping)
This commit is contained in:
Peter Steinberger
2026-01-16 07:36:46 +00:00
committed by GitHub
4 changed files with 39 additions and 11 deletions

View File

@@ -87,6 +87,14 @@ final class GatewayProcessManager {
self.status = .stopped
return
}
// Many surfaces can call `setActive(true)` in quick succession (startup, Canvas, health checks).
// Avoid spawning multiple concurrent "start" tasks that can thrash launchd and flap the port.
switch self.status {
case .starting, .running, .attachedExisting:
return
case .stopped, .failed:
break
}
self.status = .starting
self.logger.debug("gateway start requested")