Skip to content

feat(manager): WhatsApp Cloud API channel - #149

Open
Asaf-prog wants to merge 7 commits into
codex/fix-140-cancelled-token-budgetfrom
codex/whatsapp-integration
Open

Asaf-prog wants to merge 7 commits into
codex/fix-140-cancelled-token-budgetfrom
codex/whatsapp-integration

Conversation

@Asaf-prog

Copy link
Copy Markdown
Collaborator

Adds an opt-in WhatsApp Cloud API channel for one organization-owned number, following the integration plan (WA-01 to WA-05).

Stacked on #148. The base is codex/fix-140-cancelled-token-budget, so this diff shows only the WhatsApp work. GitHub retargets it to main when #148 merges.

Commits

  1. test(manager): close SQL engines owned by repository tests. Fixes intermittent aiosqlite worker-thread exceptions in the full gate (task 0018).
  2. feat(manager): prepare conversation turns idempotently. An opt-in idempotency key claims a durable receipt with the user message, so a retried preparation recovers the same turn. Migration 0007, ADR 0006.
  3. feat(manager): add durable channel storage. Provider-independent inbox, sender bindings, execution claims, webhook receipts, ordered outbox and delivery events, worker ownership, and the channel identity port. Migrations 0008–0010.
  4. feat(manager): connect WhatsApp webhook, worker, and delivery. Authenticated webhook intake, a supervised turn worker with conservative recovery, provider delivery with text controls, and /health returning 503 when the worker has stopped. Adds the regex dependency (used by text rendering).
  5. docs. ADRs 0007–0010, tasks, and review records.

Rollout

Everything is off by default. Three flags turn it on in order, and settings validation rejects a flag without its prerequisites:

  • EXTRA_WHATSAPP_ENABLED: webhook intake.
  • EXTRA_WHATSAPP_WORKER_ENABLED: turn worker. Requires intake, an organization id, and an identity resolver plugin.
  • EXTRA_WHATSAPP_SENDER_ENABLED: outbound delivery. Requires the worker.

No real account or number has been activated yet. Customer Google/JWT account linking and pilot packaging remain planned.

Validation

  • make check passes on the final commit: 1423 tests, plus ruff and mypy.
  • Every intermediate commit was checked in a separate worktree for tests, ruff, and mypy: 1126, 1159, 1174, and 1423 tests pass.
  • Migrations 0007–0010 need to run on deploy.

🤖 Generated with Claude Code

Asaf-prog and others added 5 commits October 16, 2026 14:57
Repository-contract fixtures and SQL conversation-creation helpers created aiosqlite engines without disposing them, causing intermittent worker-thread exceptions. Each test now owns and disposes its engines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An opt-in idempotency key claims a durable receipt together with the user message, so a retried preparation recovers the same turn instead of appending another. Adds saved-response recovery for channel workers and migration 0007.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Provider-independent inbox, sender bindings, execution claims, webhook receipts, ordered outbox and delivery events, worker ownership, and the channel identity port, with migrations 0008-0010.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opt-in authenticated Cloud API intake, a supervised channel turn worker with conservative recovery, provider delivery with text controls, and health reporting for a stopped worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integration plan, ADRs 0007-0010, implementation tasks 0014-0017 and 0019-0020, review records, and index entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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