Retry CLI integration commands on connection errors - #156
Merged
Conversation
Each CLI command in the lifecycle test is a separate process, and the CLI has no transport-level retry, so a single TLS/TCP reset out of a hosted CI runner fails the whole suite. Retry up to 3 attempts, only when the command reported InkboxConnectionError: the request never reached the server, so replaying it cannot double-write. Every other failure still throws at once. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158JXjhYjHhFRQg48mAhkoh
alex-w-99
marked this pull request as ready for review
August 22, 2026 03:45
dimavrem22
approved these changes
Aug 22, 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.
Each CLI command in the lifecycle test runs as its own process, and the CLI has no transport-level retry. A single TLS/TCP reset on the way out of a hosted CI runner therefore fails the whole suite. One did, on a
identity mail-rules deletecall; the request never reached the server and every other command in the run passed.inkbox()now retries up to 3 attempts, only when the command reportedInkboxConnectionError— the request provably never completed at the app, so replaying it cannot double-write. Linear 1s/2s backoff, blocking, sinceinkbox()is sync. Every other failure, including any HTTP status, still throws on the first attempt. Each retry logs a warning so a rising rate stays visible in the run log.Scope is the integration harness only. No SDK or CLI behavior changes, so no version bump.
Testing
tsc --noEmitclean intests/integration/cli.InkboxConnectionError, then succeeding: retried twice, ~3.3s total, returned the success payload.InkboxNotFoundError: threw in 87ms, no retry.