feat(cli): per-message send_at scheduling on messages send + message-to (#623)#48
Merged
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`.
…to (#623) Adds optional `--send-at` (ISO 8601 string) to `cueapi messages send` and `cueapi message-to` — ports the private-monorepo cueapi #623 server-side change that's already shipped on POST /v1/messages (MessageCreate.send_at in app/schemas/message.py). Server contract pinned: - NULL send_at (default) → send now - Future timestamp → message gates inbox-fetch + push delivery until send_at <= now() - Past timestamps → forgiving fallback (treated as send-now) - Same semantics as cue-fire send_at (PR #618, already shipped) Wire format: send_at flows in the BODY of POST /v1/messages, NOT a header. Mirrors the cue-fire send_at transport. Different from idempotency_key, which is a header. Verify-server-transport-per- endpoint pinned in tests so a refactor doesn't accidentally promote it to a header. Tests: - messages_send: 2 new (send_at_omitted_by_default, send_at_passed_in_body) - message_to: 2 new (send_at_passed_in_body, send_at_omitted_when_unset) - 171/171 pass total This unblocks the cueapi-action port (its messages-send shell branch needs the underlying CLI flag to surface --send-at to GitHub Actions callers). Parallels cueapi-python (already shipped) and cueapi-mcp (just shipped via PR #33) ports of the same private-monorepo PR #623.
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 optional
--send-at(ISO 8601 string) tocueapi messages sendandcueapi message-to— ports the private-monorepo cueapi #623 server-side change that's already shipped onPOST /v1/messages(MessageCreate.send_atinapp/schemas/message.py).Server contract pinned
NULLsend_at(default) → send nowsend_at <= now()send_at(PR #618, already shipped via--send-atoncueapi fire)Wire format
send_atflows in the body ofPOST /v1/messages, NOT a header. Mirrors the cue-firesend_attransport. Different fromidempotency_key, which is a header. Verify-server-transport-per-endpoint pinned in regression-guard tests.Changes
cueapi/cli.py:messages send: new--send-atflag, body-field wiringmessage-to: new--send-atflag, body-field wiring (parity withmessages send)tests/test_cli.py: 4 new testsmessages_send:send_at_omitted_by_default,send_at_passed_in_bodymessage_to:send_at_passed_in_body,send_at_omitted_when_unsetWhy this PR matters now
This unblocks 2 downstream ports:
messages-sendshell branch needs the underlying CLI flag to surface--send-atto GitHub Actions callers.message-to: parity withmessages send— same surface treatment.Parallels:
messages.send(..., send_at=...)— already shippedcueapi_send_message.send_at— just shipped via cueapi-mcp PR feat: addcueapi workers list/delete+cueapi key webhook-secret get/regenerate#33 (today)Tests
Test plan
app/schemas/message.pyMessageCreate.send_at🤖 Generated with Claude Code