This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Conversation
- Add alive flag, isAlive(), restart() to DesktopGatewayServer - Fix stop() to handle stale (ERR_SERVER_NOT_RUNNING) handles gracefully - Attach persistent error/close handlers with onUnexpectedClose callback - Resolve actual OS-assigned port via server.address() in start() - Extract GatewayRecoveryManager with single-flight restart, epoch guard, and gatewayHealthy flag into gateway-recovery.ts - Wire recovery into DesktopApplication: liveness probe on cloud reconnect, auto-restart on unexpected close, gatewayHealthy in presence derivation - Refactor onCloudSocketStatus to probe gateway before enabling executor - Add serverAlive/gatewayHealthy to runtime status endpoint - Switch all test files from fixed ports to OS-assigned port 0, eliminating EADDRINUSE failures when test files run concurrently - Add 5 server-level liveness tests and 6 recovery state machine tests Testing: - All 323 tests pass with 0 failures - Typecheck and lint clean Risks: - CloudSocketService still sends immediate presence on hello.ack before liveness probe completes (documented as known limitation, deferred)
Code Review SummaryStatus: Approved Reviewers: Bug Hunter A (x3), Bug Hunter B, Unified Auditor, Premise Reviewer, Cloud Command Executor Specialist Findings
MEDIUM Issues (consider)
Validation Stats
Recommendation: Approve -- the gateway liveness detection and auto-recovery feature looks solid. One low-priority observability improvement suggested but not blocking. |
Add warn log when recoverGateway deduplicates a concurrent call so the second trigger reason is not silently dropped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing:
Risks:
https://app.closedloop.ai/implementation-plans/PLAN-86