feat(cues): add bulk_delete (cueapi #650 / cli #46 parity)#37
Merged
Conversation
Adds `client.cues.bulk_delete(ids)` — wraps POST /v1/cues/bulk-delete.
Closes Backlog row cmousydyn (mistitled 'messages'; actually cues per
PR #650 + cli #46; PM corrected title 2026-05-09 ~20:45Z).
Returns {"deleted": [...], "skipped": [...]} — per-ID atomic, not
batch atomic. IDs that don't exist OR aren't owned by the caller
land in `skipped` (silent skip on miss; no info leak about other
tenants' cues).
Sends X-Confirm-Destructive: true header automatically (server
requires it for any bulk-destructive endpoint, mirrors the
agents-webhook-secret-regenerate + auth-key-regenerate pattern).
Client-side validation:
- Empty `ids` → ValueError "at least one cue ID"
- > 100 IDs → ValueError "Max 100" (matches server cap; fail-fast)
Tests: 7 new in TestBulkDelete class — happy path, with-skipped,
header pin, empty-raises, over-100-raises, exactly-100-ok boundary,
iterable-not-just-list. 11/11 pass in tests/test_cues_resource.py.
Parity context: cueapi-cli #46 shipped this as `cueapi bulk-delete`
on 2026-05-06. cueapi-mcp + cueapi-action ports follow as separate
PRs in the same Backlog row.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 9, 2026
Merged
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
Adds
client.cues.bulk_delete(ids)to the SDK. Closes Backlog rowcmousydyn(which was originally mistitled 'messages'; PM corrected to 'cues' during my pre-verify pass — see PR description note below).What's added
cueapi/resources/cues.py: newbulk_delete(ids: List[str]) -> Dict[str, List[str]]method onCuesResource.tests/test_cues_resource.py: newTestBulkDeleteclass with 7 tests (happy-path, with-skipped, header pin, empty-raises, over-100-raises, exactly-100-ok boundary, iterable-input).CHANGELOG.md:[Unreleased]section with the new method's entry.Behavior
Wraps
POST /v1/cues/bulk-deletewith body{"ids": [...]}. Per-ID atomic, NOT batch atomic — IDs that don't exist OR aren't owned by the caller land in theskippedarray (silent skip on miss; no info leak about other tenants' cues). Cascade FK handles executions + dispatch_outbox cleanup.Sends
X-Confirm-Destructive: trueheader automatically (server requires it for any bulk-destructive endpoint, mirrorsagents-webhook-secret-regenerate+auth-key-regenerate).Client-side validation (fail-fast):
ids→ValueError("ids must contain at least one cue ID.")Stats
Test plan
tests/test_cues_resource.py(4 pre-existing TestFire + 7 new TestBulkDelete)pip install -e ".[dev]")test_bulk_delete_sends_confirm_destructive_header)test_bulk_delete_exactly_100_ids_ok+test_bulk_delete_over_100_ids_raises)TestFirepattern (MagicMock-based unit tests for SDK methods)Note re: Backlog row title
Backlog row
cmousydynwas originally titled "Parity port: bulk delete messages (#650) → cueapi-python + cueapi-mcp + cueapi-action". Pre-verify caught the mismatch (PR #650 is cues, not messages; cueapi-core has zero@router.deleteon messages.py). PM patched the row title to 'cues' 2026-05-09 ~20:45Z and confirmed interpretation 1 (port the cues bulk-delete). This PR ships the cueapi-python piece; cueapi-mcp + cueapi-action follow as separate PRs in the same row.Related
feat(cues): bulk delete + stale-cue discovery filters)feat(cues): add bulk-delete subcommand)POST /v1/cues/bulk-delete(private cueapiapp/routers/cues.py:263)Closes
cmousydyn000004lgs0drkbap— this PR ships the cueapi-python piece. Row stays in-progress until cueapi-mcp + cueapi-action also ship.🤖 Generated with Claude Code