Skip to content

fix: give every CLI invocation a random idempotency seed - #174

Merged
caballeto merged 2 commits into
mainfrom
fix/random-idempotency-seed
Oct 26, 2026
Merged

caballeto merged 2 commits into
mainfrom
fix/random-idempotency-seed

Conversation

@caballeto

Copy link
Copy Markdown
Member

Found by mono #1438: devhelm tags create foo twice 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-key still pins the key explicitly. This matches the SDKs.

Tests: test/lib/idempotency-key.test.ts covers a fresh seed per invocation (in CI too), one key per POST, the --idempotency-key pin, and a subprocess test running the same status-pages create twice in one CI step with distinct keys. Full suite: 1,243 passed.

🤖 Generated with Claude Code

caballeto and others added 2 commits October 26, 2026 12:00
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>
@caballeto
caballeto merged commit 8179c79 into main Oct 26, 2026
3 checks passed
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.

1 participant