Repository navigation
fix: give every CLI invocation a random idempotency seed - #174
Merged
Merged
Conversation
The CI-derived seed (run, attempt, job, step, argv) made a second identical command in one CI step replay the first response: a duplicate create reported success instead of its 409. Released 1.11 sends no key, so every command was a fresh request. A random seed per invocation keeps that, and the SDK transport still reuses a key for retries of one request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Found by mono #1438:
devhelm tags create footwice in one CI step returned success the second time. The CI-derived seed (doc 32 D-7) replayed the first 201 instead of letting the API answer 409.Backwards compatibility: released CLI 1.11.0 sends no
Idempotency-Key, so every command is a fresh request. With a random seed per invocation, separate commands behave exactly as on 1.11. What's new is that retries inside one command are deduplicated (the SDK transport reuses the key only for retries).--idempotency-keystill pins the key explicitly. This matches the SDKs.Tests:
test/lib/idempotency-key.test.tscovers a fresh seed per invocation (in CI too), one key per POST, the--idempotency-keypin, and a subprocess test running the samestatus-pages createtwice in one CI step with distinct keys. Full suite: 1,243 passed.🤖 Generated with Claude Code