Closed
Conversation
When the daemon is killed or crashes, bridge.ts now automatically attempts to reconnect instead of staying permanently disconnected. Uses exponential backoff (1s → 2s → 4s → ... → 30s cap) and re-runs the full ensureDaemonRunning + connect + attachClaude flow. Also adds DaemonClient unit tests covering connect, disconnect, message routing, reply lifecycle, and reconnect scenarios. Closes #16 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
E2E tests (8): spin up a real daemon on isolated ports, verify health, PID file, client connect/disconnect, graceful reply failure when no TUI, and the full kill → restart → reconnect cycle. DaemonClient unit tests (10): connect, reject, disconnect events, message routing (codexMessage, status), reply lifecycle, pending reply rejection on disconnect, reconnect after disconnect, attachClaude. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing: the reconnect fixes in this PR have been absorbed and enhanced in feat/plugin-packaging (PR #12). The current branch includes all of #17's changes plus additional hardening (notification throttling, single-flight reconnect, daemon-client socket identity tracking, daemon idle timeout/sendPings). |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
connectToDaemon()from the one-shotclaude.on("ready")handler into a reusable functionreconnectToDaemon()with exponential backoff (1s → 2s → 4s → ... → 30s cap) triggered from thedisconnectevent handlerensureDaemonRunning→connect→attachClaudeflow, so it also handles the case where the daemon needs to be re-launchedDaemonClientunit tests (10 tests): connect, reject, disconnect events, message routing, reply lifecycle, reconnect after disconnectTest plan
bun run typecheckpassesbun test src/— all 73 tests pass (10 new DaemonClient tests)Closes #16
🤖 Generated with Claude Code