Repository navigation
fix: #620 a reset wake probe reached a live peer, so it isn't offline - #623
Merged
Merged
Conversation
The listener ends each connection as it opens. When that beats the sender's event loop to the connect, Bun rejects it with ECONNRESET, though the wake has run. poke counted that as a failure and retried, and after the ladder reported a live peer as offline. A stale socket reports ECONNREFUSED, so the two stay distinct. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
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.
Problem
dm_sendcan tell the sender a live peer is offline, though the peer was woken and got the message.pokecounts a connect as failed when the listener accepted and closed it first (Bun:ECONNRESET).Value
delivered_nowand the "Recipient offline" note can be trusted, andpeer_listand the otherpokecallers stop reading a live holder as absent for this reason.Solution
canConnectreturns true onECONNRESET. A stale socket reportsECONNREFUSEDand still takes the retry ladder, then reads as offline.Details
Refs #620, which stays open until this is checked in real sessions (see below).
Test:
src/local/wakeup.test.tsruns a listener in its own process and requires exactly one wake per poke, with every poke true, plus a stale-file and a missing-file case. The first test failed 20 of 20 runs on the old code, 15 of them with an outright false offline, and passes 12 of 12 with the fix.Suite: full root suite 2022 pass, 0 fail, with HOME in a scratch directory.
Not established: the rate seen in real Claude Code sessions (about 4 of 6 reads) did not reproduce with real
grayboard mcpchildren on the old code: 0 of 500 sends, from source or compiled, at 100 ms or 3 s gaps, or pinned to one core. Those runs did show retries, up to nearly the whole ladder. The bare listener's rate depends heavily on timing, which may be the difference, but nothing here measures it. So this fixes a proven cause; whether it's the only cause of that rate needs a rerun in real sessions.Parity: no
docs/parity.mdcell changes; this corrects a result in local mode, whose cells already claim it. Hosted delivery doesn't use this probe.Docs gate: pushed with
DOCS_GATE_BYPASS=1because of the existing drift in #615. No docs describe this behaviour.🤖 Generated with Claude Code