fix(cli): agents webhook-secret regenerate sends X-Confirm-Destructive header (Bug cmp03hy9o)#47
Merged
mikemolinet merged 1 commit intoMay 10, 2026
Conversation
…e header (Bug cmp03hy9o)
`cueapi agents webhook-secret regenerate <ref>` was making the
POST /v1/agents/{ref}/webhook-secret/regenerate request without
the `X-Confirm-Destructive: true` header that the server requires.
Result: even after the user typed `y` at the confirmation prompt,
the request was rejected HTTP 400 server-side.
Surfaced 2026-05-10 from Phase 2 messaging smoke testing —
identical bug shape to the one already fixed on
`cueapi key webhook-secret regenerate` (which did pass the header).
Mirror the existing pattern: pass the header on the httpx POST
right after the Y/N confirm clears.
Tests:
- New `test_agents_webhook_secret_regenerate_sends_destructive_header`
pins the header on the wire — same shape as the existing
`test_key_webhook_secret_regenerate_sends_destructive_header`.
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
cueapi agents webhook-secret regenerate <ref>was POSTing to/v1/agents/{ref}/webhook-secret/regeneratewithout theX-Confirm-Destructive: trueheader that the server requires for destructive operations.Result: even after the user typed
yat the Y/N confirmation prompt, the request returned HTTP 400 server-side.Surfaced 2026-05-10 from Phase 2 messaging smoke testing (Backlog Bug
cmp03hy9o). Identical bug shape to the one already fixed on the parentcueapi key webhook-secret regeneratecommand (which correctly passes the header).Fix
Three-line change: pass
headers={"X-Confirm-Destructive": "true"}on theclient.post(...)call insideagents_webhook_secret_regenerate(cueapi/cli.py).Tests
New:
test_agents_webhook_secret_regenerate_sends_destructive_headerpins the header on the wire — same shape as the existingtest_key_webhook_secret_regenerate_sends_destructive_header.Test plan
_WSClientcapture fixture)🤖 Generated with Claude Code