Skip to content

fix(cli): agents webhook-secret regenerate sends X-Confirm-Destructive header (Bug cmp03hy9o)#47

Merged
mikemolinet merged 1 commit into
mainfrom
fix/agents-webhook-secret-regenerate-destructive-header
May 10, 2026
Merged

fix(cli): agents webhook-secret regenerate sends X-Confirm-Destructive header (Bug cmp03hy9o)#47
mikemolinet merged 1 commit into
mainfrom
fix/agents-webhook-secret-regenerate-destructive-header

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

cueapi agents webhook-secret regenerate <ref> was POSTing to /v1/agents/{ref}/webhook-secret/regenerate without the X-Confirm-Destructive: true header that the server requires for destructive operations.

Result: even after the user typed y at 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 parent cueapi key webhook-secret regenerate command (which correctly passes the header).

Fix

Three-line change: pass headers={"X-Confirm-Destructive": "true"} on the client.post(...) call inside agents_webhook_secret_regenerate (cueapi/cli.py).

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.

tests/test_cli.py::test_agents_webhook_secret_regenerate_sends_destructive_header PASSED
167 passed

Test plan

  • Local pytest: 167/167 pass (4 prior webhook-secret-regenerate tests + 1 new = 5)
  • Header pin asserted at the request capture point (uses existing _WSClient capture fixture)
  • CI green
  • Admin-merge + ping cue-pm so they can retry the Phase 2 flow via CLI

🤖 Generated with Claude Code

…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`.
@govindkavaturi-art govindkavaturi-art enabled auto-merge (squash) May 10, 2026 18:22
@mikemolinet mikemolinet merged commit 320bf2b into main May 10, 2026
5 checks passed
@mikemolinet mikemolinet deleted the fix/agents-webhook-secret-regenerate-destructive-header branch May 10, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant