Skip to content

feat(manager): WhatsApp pilot packaging and operations (WA-06) - #150

Merged
Asaf-prog merged 5 commits into
codex/whatsapp-integrationfrom
codex/whatsapp-pilot-packaging
Oct 22, 2026
Merged

Asaf-prog merged 5 commits into
codex/whatsapp-integrationfrom
codex/whatsapp-pilot-packaging

Conversation

@Asaf-prog

Copy link
Copy Markdown
Collaborator

Final planned stage of the WhatsApp integration plan: an administrator runbook, a deployable pilot example, operational monitoring, and a fake-provider restart rehearsal (task 0021).

Stacked on #149, which is stacked on #148. GitHub retargets each PR when its base merges.

Commits

  1. feat(manager): log channel status and webhook rejections.
    • The worker logs one channel status: line per EXTRA_WHATSAPP_STATUS_LOG_SECONDS (default 60). It reports queue counts, the oldest unfinished and unsent ages, and unknown, failed, and blocked reply counts.
    • Each read is bounded to five seconds, so monitoring cannot stall scheduling or a graceful drain.
    • Every rejected webhook request logs whatsapp webhook rejected: reason=<fixed reason>.
    • No line contains message text, sender IDs, tokens, or provider message IDs.
  2. feat(examples): add the WhatsApp pilot example, runbook, and rehearsal.
    • docs/WHATSAPP_RUNBOOK.md covers preflight, deployment, staged enablement and pause states, health and monitoring, restart recovery, rollback, retention, and the smoke-test checklist.
    • examples/whatsapp-pilot/ contains a tool-free assistant, an allowlist identity resolver for a closed pilot, .env.example with every stage off, and a compose file that runs agent-manager on a durable volume.
    • The rehearsal test proves that a message accepted while the worker is paused survives restarts and is answered and sent exactly once, that a signed delivered callback is projected, and that nothing is resent after a further restart.

The user chose structured log lines for monitoring, so there is no new HTTP endpoint, CLI, dependency, or migration.

Review corrections included

  • Exposure: the example binds port 8100 to loopback. The manager's web conversation API is anonymous by default, so publishing the port would bypass the WhatsApp identity check. The runbook requires a proxy that forwards only the webhook path.
  • Storage settings: EXTRA_DB_URL in .env now overrides the compose default, so a PostgreSQL configuration is no longer silently replaced by SQLite.
  • Rollback in Docker: the rollback runs through docker compose run --entrypoint sh, because the image entrypoint passes other commands to agentctl.
  • Allowlist entries: a malformed entry, such as roles given as a string, denies access instead of granting the wrong roles.

Each code correction has a regression test that fails without it.

Validation

  • make check passes: 1441 tests, plus ruff and mypy. The first commit was also checked alone in a worktree: 1438 tests.
  • agentctl validate passes on the example. docker compose config was checked with and without a PostgreSQL .env.
  • The rollback downgrade to 0006 was rehearsed on a temporary database: the channel tables are removed and conversations are kept.
  • Not run: the example has not been started in Docker (no local daemon), and nothing was tested against a real Meta account.

Still pending

  • Automatic retention for channel data. There is none yet, and the runbook says so.
  • Organization account linking (Google/JWT).
  • The explicitly authorized real-number smoke test.

🤖 Generated with Claude Code

Asaf-prog and others added 5 commits October 16, 2026 15:47
The worker logs one `channel status:` line per configured interval with queue
counts, the oldest unfinished and unsent ages, and unknown, failed, and blocked
reply counts. The read is bounded to five seconds so monitoring cannot stall
scheduling or a graceful drain. Every rejected webhook request logs a fixed
reason. No line contains message text, sender IDs, tokens, or provider IDs.

Adds EXTRA_WHATSAPP_STATUS_LOG_SECONDS (default 60).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runbook covers preflight, deployment, staged enablement and pausing,
health and status logs, restart recovery, rollback, retention, and the
real-number smoke-test checklist. The example runs agent-manager on durable
storage with a tool-free assistant and an allowlist identity resolver; its port
is bound to loopback because the web conversation API is anonymous by default.

A fake-provider rehearsal proves that paused intake survives restarts, is
answered and sent exactly once, projects a delivered callback, and is not
resent after a further restart.

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

@Asaf-prog Asaf-prog left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

1. Summary

Reviewed the incremental monitoring, rejection logging, pilot packaging, allowlist resolver, runbook and restart rehearsal. Synced the updated #149 head, resolving tasks/README.md while preserving both entries.

2. Blocking issues

No new blocker confirmed in the incremental #150 changes. The inherited control/suppression defect in #149 blocks the stack: with intake/worker on and sender off, /stop becomes failed and subsequent text still runs. See #149 (review) . The Answering pause state documented here exercises that configuration.

3. Non-blocking issues

Automatic channel retention and operator reconciliation remain follow-ups. The status scan over retained history is an acknowledged pilot-volume limitation.

4. Architecture concerns

Monitoring uses a separate read port; status reads are bounded to five seconds and failures do not stop scheduling. The example keeps organization identity in its plugin and binds the manager port to loopback. No new engine/YAML contract or migration is introduced by #150.

5. Security concerns

Inspected rejection logging uses fixed reasons. The allowlist denies malformed entries and re-reads per lookup. The example is tool-free, all three stages default off, and the runbook requires forwarding only the webhook path plus real account linking before internal data access.

6. Testing gaps

make check passed on this head: 1,450 tests / 27 warnings, formatting, lint, mypy and generated-stub checks. A temporary merge with current main (ffe1d2f) also passed make check with 1,453 tests, plus agentctl validate examples/whatsapp-pilot/agents.yml. The temporary main merge was discarded after validation. Local tests use SQLite and fake provider/engine/identity; live Meta, live PostgreSQL and Docker startup were not exercised by this review.

7. Suggested improvements

Extend the staged-enable/restart rehearsal to cover worker-on/sender-off controls and suppression after fixing #149.

8. Final recommendation

Approve the incremental changes after the upstream #149 blocker is corrected and the stack is revalidated. Keep #150 unmerged meanwhile. This COMMENT is not a formal GitHub approval: the connected account is the author, and main requires an independent approving reviewer. Merge order after correction and review is #148, #149, #150. No main merge was performed.

@Asaf-prog
Asaf-prog merged commit 85e1063 into codex/whatsapp-integration Oct 22, 2026
3 checks passed
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