feat: add ping/pong heartbeat to WebSocket connections#42
Merged
Ark0N merged 1 commit intofeat/ws-terminal-io-upstreamfrom Mar 14, 2026
Merged
feat: add ping/pong heartbeat to WebSocket connections#42Ark0N merged 1 commit intofeat/ws-terminal-io-upstreamfrom
Ark0N merged 1 commit intofeat/ws-terminal-io-upstreamfrom
Conversation
Detect stale connections that TCP keepalive won't catch for minutes, especially through tunnels and proxies. Pings every 30s with a 10s pong timeout — if the client doesn't respond, the socket is terminated and all timers cleaned up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SGudbrandsson
pushed a commit
to SGudbrandsson/Codeman
that referenced
this pull request
Mar 23, 2026
The server was dropping the `data` field from hook-event POST requests, so notifications always showed generic messages. Now forwards tool name, command, question text, and reason to the frontend. Notifications now show: - permission_prompt: "Bash: docker push prod:latest" - elicitation_dialog: "Merge PR Ark0N#42 to main?" - idle_prompt: custom message if provided - stop: reason if provided Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
closehandler to prevent leaksDetails
The
wslibrary's built-inping()/on('pong')methods are used. Browser WebSocket clients respond to pings automatically at the protocol level — no client-side changes needed.Each ping cycle:
alive = false, sends a ping frame, starts a 10s pong timeoutalive = true, clears the timeoutalivestill false:socket.terminate()Test plan
npx tsc --noEmitpasses (verified)🤖 Generated with Claude Code