Retry every client connection failure; make long outages cheap - #103
Merged
Merged
Conversation
The CLI client used to exit when its first connection attempt failed, even for transient errors, so a client started before its server (or against a server down for maintenance) died instead of waiting. The reconnect loop now treats a failed attempt exactly like a lost connection: only permanent errors (rejected key, bad config, proxy port in use) end the session. auto_reconnect=false and max_reconnect_attempts keep their names but now cover the first attempt too. Long outages no longer cost much: the backoff cap rises from 60s to 5 min, and the endpoint rebuild still fires after the third consecutive failure but then repeats at most every 30 min per outage instead of on every third attempt. On iOS, the app coming to the foreground ends a backoff wait immediately with a fresh series, as a restored network path already did. The loop publishes its retry state (failed attempts, last error, next attempt time); the CLI status snapshot carries it and the control panel shows it on the phase line. Docs, config example, flag help, and FFI comments updated; unit and e2e tests cover the new policy. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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
--no-auto-reconnectand--max-reconnect-attemptskeep their names but now cover the first attempt too.Test plan
ci/unix/ci.sh(clippy-D warnings+ core and CLI tests) green; workspace clippy including desktop clean--no-auto-reconnectand--max-reconnect-attempts 1exit nonzero as documented; unauthorized key exits immediately without retry./build-ios.sh releaserebuilt the xcframework on the Mac VM🤖 Generated with Claude Code