Repository navigation
fix(client-runtime): retry a dropped SSH environment promptly - #27
Merged
Merged
Conversation
An SSH environment that failed a few times in a row waited minutes for its next automatic attempt, while the link was usually back long before, so "Retry now" reconnected far sooner. SSH-backed environments now retry at once after an attempt that failed slowly (3 seconds or more, typically a timeout), and back off 1, 2, 4 ... at most 20 seconds after fast failures. SSH failures only the user can fix (a cancelled or unanswered password prompt, a refused key, an untouched security key, a changed host key) are now classified as authentication failures, so they wait for the user instead of prompting again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ilures 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.
Problem
After a few failures in a row, the supervisor's exponential backoff (up to 5 minutes) left an SSH environment waiting minutes for its next automatic attempt. Over a flaky link the network was usually back long before that, so pressing Retry now reconnected far sooner.
Change
SshConnectionTarget) get their own retry ladder insupervisor.ts:ConnectionBlockedError(authentication), which waits for Reconnect, foregrounding, or a network change. Without this, the immediate retry would have re-prompted for a password in a loop.docs/internals/connection-runtime.mdand the Desktop-managed SSH section ofdocs/user/remote-access.md.Not included: a "link restored" signal from the desktop
The desktop has no existing push signal to the renderer saying an SSH link is healthy again: its SSH layer only runs inside an
ensureSshEnvironmentcall that the client attempt is already waiting on, and its control master emits no "recovered" event. With this ladder, the gaps it would cover are small: a stalled link is always inside an attempt (slow failures retry at once), fast failures wait at most 20 s, and the OS going back online already ends the wait. Building one would mean a new desktop-side probe loop, so it is left out.Checks
vp test run src/connection/supervisor.test.ts(client-runtime)vp test run src/connection/platform.test.ts(web)vp run check:changed greaber/grant/main(format, lint, knip, typecheck of 7 packages, tests)vp test run src/connection/supervisor.test.ts(client-runtime)vp run check:changed greaber/grant/main🤖 Generated with Claude Code