Repository navigation
Detect a dead WebSocket and say why ingress stopped - #27
Open
duharry0915 wants to merge 1 commit into
Open
duharry0915 wants to merge 1 commit into
duharry0915 wants to merge 1 commit into
Conversation
The plugin logged "subscribed" when it sent the subscribe frame and dropped every non-message frame, so the server's ack and its error frames were never seen. A socket that disappeared without a close event was never recreated, and an abort ended the whole ingress silently. Log "subscribed" only on the server's ack, and reconnect when no ack arrives within 30s or the server refuses the subscription. Recycle a connection that sees no frame for 20 minutes, twice the server's idle close. Log server error frames, the close code and reason, and the ingress stop. Refs #23 Co-Authored-By: Claude Opus 5.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.
Refs #23.
What #23 showed
The plugin logged
AgentMail WebSocket subscribed, then nothing: no close, no reconnect, no socket. That pattern can't be diagnosed or recovered from the plugin today, for three reasons:subscribedframe and reports failures with anerrorframe. The plugin dropped both.closeanderror.Change
All of it is in
src/channel/src/websocket.ts:subscribedis logged when the server acks. If no ack arrives within 30s, or the server answers with anerrorframe, the connection is recycled through the existing backoff.errorframes are logged asname: message.no frames for 20 minutes,subscription not confirmed within 30s, orsubscription refused.AgentMail WebSocket ingress stopped for account …when it ends.REST catch-up already ran on its own timers independent of the socket. It still stops only when the account is aborted, and now that stop is logged.
What this does not settle
I could not reproduce #23. If the socket was dying without a close, the watchdog now recovers it within 20 minutes. If the host was aborting the account, this change won't stop that, but the
ingress stoppedline will now show it in the reporter's logs. With 0.2.4 the reporter's logs should tell the two apart.Tests
websocket.test.ts: the ack-gated log, the ack timeout, the idle recycle (including re-arming on a frame), a refused subscription, and close-code logging after a non-fatal server error. All 5 fail onmainand pass here.npm test: 251/251 pass.npm run buildis clean.🤖 Generated with Claude Code