Skip to content

Retry CLI integration commands on connection errors - #156

Merged
dimavrem22 merged 1 commit into
mainfrom
test/cli-integration-retry-connection-errors
Aug 22, 2026
Merged

Retry CLI integration commands on connection errors#156
dimavrem22 merged 1 commit into
mainfrom
test/cli-integration-retry-connection-errors

Conversation

@alex-w-99

Copy link
Copy Markdown
Contributor

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 delete call; 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 reported InkboxConnectionError — the request provably never completed at the app, so replaying it cannot double-write. Linear 1s/2s backoff, blocking, since inkbox() 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 --noEmit clean in tests/integration/cli.
  • Stubbed CLI binary failing twice with InkboxConnectionError, then succeeding: retried twice, ~3.3s total, returned the success payload.
  • Stubbed CLI binary failing with InkboxNotFoundError: threw in 87ms, no retry.
  • CI: the scheduled SDK integration run exercises this path against a live environment.

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
alex-w-99 marked this pull request as ready for review August 22, 2026 03:45
@dimavrem22
dimavrem22 merged commit 67b5193 into main Aug 22, 2026
17 checks passed
@dimavrem22
dimavrem22 deleted the test/cli-integration-retry-connection-errors branch August 22, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants