Skip to content

feat(cli): send idempotency keys on message and campaign writes - #11

Merged
purpshell merged 4 commits into
devfrom
codex/messaging-idempotency
Sep 23, 2026
Merged

purpshell merged 4 commits into
devfrom
codex/messaging-idempotency

Conversation

@purpshell

@purpshell purpshell commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Message sends, reactions, edits, deletions, and campaign create/launch requests send an Idempotency-Key by default. Each new invocation receives a fresh key; SDK retries within that invocation reuse it. For a retry from another process, callers choose an explicit key before the first attempt and preserve the request, credential, and API version.

The command help and README now describe the API's recorded-outcome behavior accurately: completed messaging writes return 409 idempotency_completed without the original response body. In-progress and uncertain outcomes remain fenced; a new key is not a recovery shortcut. Mark-seen, typing, star, and campaign pause/resume/stop/requeue do not gain server deduplication from this header.

All eleven message-send variants generate a key. The installed npm dependency is @polymorfa/sdk@0.1.0-dev.20260922102711, pinned in both manifests; edit/delete obtain their default key from this SDK.

Six-part assessment

Part Status Evidence
API Unaffected implementation Uses the existing messaging and campaign idempotency contract. Middleware and recorded-outcome behavior checked at monorepo 360afa8239140b2857f0622120dfccf2cf5de025, unchanged at 63111fec728ac3ebc9a825ea57ebc4c592abdafc. No route, scope, or response shape changes.
SDKs Unaffected implementation; dependency verified Installed npm artifact supplies default keys for edit/delete and reuses keys during automatic retries. No language contract change.
CLI Updated Default keys, validation, command help, and retry guidance cover all send variants and affected writes.
Docs Updated README and compiled help match the API. Public messaging guide already describes this behavior; CLI release copy remains internal until a CLI package is available.
Feature releases Existing authority preserved No new flag, entitlement, enrollment, or rollout. CLI publication and compatible deployed API acceptance remain separate gates; no public shipped changelog is added.
Admin Unaffected No staff action, capability bridge, worker, or database authority changes.

Verification

  • Build, typecheck, scoped ESLint/Prettier, and diff checks passed.
  • 55 focused message, send-variant, campaign, and idempotency tests passed.
  • Compiled help checked for all 16 affected commands.
  • Four separate compiled processes against a local HTTP fixture verified distinct generated keys across invocations, stable explicit keys/body/API version, and a completed retry returning a nonzero idempotency_completed error without resending or returning the original message ID.

No live WhatsApp send, campaign, deployed API, or retention-expiry boundary was exercised. Exact-head hosted CI must pass before merge; publishing the CLI remains separate.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: a4f4b28d-b164-474a-af16-59cb2080eb0f

📥 Commits

Reviewing files that changed from the base of the PR and between 0895876 and dcb002c.

📒 Files selected for processing (22)
  • README.md
  • src/commands/campaign/create.ts
  • src/commands/campaign/launch.ts
  • src/commands/channel/message/react.ts
  • src/commands/message/delete.ts
  • src/commands/message/edit.ts
  • src/commands/message/react.ts
  • src/commands/message/send/audio.ts
  • src/commands/message/send/buttons.ts
  • src/commands/message/send/contact.ts
  • src/commands/message/send/document.ts
  • src/commands/message/send/image.ts
  • src/commands/message/send/list.ts
  • src/commands/message/send/location.ts
  • src/commands/message/send/poll.ts
  • src/commands/message/send/template.ts
  • src/commands/message/send/text.ts
  • src/commands/message/send/video.ts
  • src/input/message-send.ts
  • test/commands/campaigns.test.ts
  • test/commands/message-sends.test.ts
  • test/commands/messages.test.ts

Comment @coderabbitai help to get the list of available commands.

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T11:54:57.212765Z 7b0c25b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: bdada86abf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@purpshell
purpshell force-pushed the codex/messaging-idempotency branch from bdada86 to 4a264f4 Compare September 22, 2026 11:35
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a264f4b93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/message/send/text.ts Resolved
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 7b0c25b601

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@purpshell
purpshell marked this pull request as ready for review September 23, 2026 09:27
@purpshell
purpshell merged commit 30f0efb into dev Sep 23, 2026
3 checks passed
@purpshell
purpshell deleted the codex/messaging-idempotency branch October 26, 2026 15:52
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