{{ message }}
fix: add VPN wake rebind hook#26739
Open
EhabY wants to merge 2 commits into
Open
Conversation
johnstcn
reviewed
Jun 26, 2026
johnstcn
left a comment
Member
There was a problem hiding this comment.
Change LGTM but deferring approval to Spike or Ethan.
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.

After macOS sleep/wake, stale Coder Connect paths currently recover only when magicsock's periodic re-STUN runs, which can leave new SSH dials timing out for several minutes. This adds a narrow CoderVPN wake RPC so Coder Desktop can trigger the existing link-change recovery path,
RebindplusReSTUN, immediately on wake instead of waiting for that periodic fallback.This only exposes the tunnel-side hook and does not add polling or health checks. Coder Desktop still needs to send
WakeRequestfrom its OS wake notification handler.Recovery timing
magicsock's background re-STUN is not a reliable fallback across sleep:
magicsock.updateEndpoints), so the stale path lingers up to ~26s.sessionActiveTimeout),shouldDoPeriodicReSTUNLockedreturns false and the periodic timer stops entirely. Sleep is idle by definition, so on wake there is no scheduled re-STUN at all.The wake RPC collapses this to a single RPC round-trip:
Rebind+ReSTUN("wake")fire immediately on the OS wake event, re-homing the path right away instead of depending on a timer that isn't running.Follow-up
Coder Desktop must emit the hook on wake: coder/coder-desktop-macos#260.
Refs #26736
Generated by Coder Agents.