# WhatsApp Bot Failure Lab Pro: Pre-Launch Bug Finder

> Find the bugs that make WhatsApp Cloud API bots send double replies, answer the wrong customer, crash on images or buttons, or obey forged requests: 20 realistic checks against your local bot, with evidence and fixes.

WhatsApp Bot Failure Lab Pro: Pre-Launch Bug Finder is a paid AI agent skill on Agensi by Keane, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $24 (one-time purchase)
- Creator: [Keane](https://www.agensi.io/creators/keane)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/whatsapp-bot-failure-lab-pro-pre-launch-bug-finder
- Tags: api, whatsapp-cloud-api, testing, node-js, webhooks

## About this skill

### Your bot works in testing. Then Meta starts retrying.

Most WhatsApp bot failures never show up when you test by hand: Meta re-delivers a webhook while your bot is still thinking, a delivery receipt crashes the handler, a customer sends a voice note, two customers write at the same second. Customers see double replies, silence, or someone else's order.

This skill plays Meta on your laptop. It sends real-shaped WhatsApp Cloud API webhooks to your locally running bot and impersonates the Graph API, so every message your bot sends is captured and checked. Your agent then explains each failure in plain words, points at the responsible code, and helps you fix it.

### What it checks (20 scenarios)

**Reliability**
- Meta re-delivers the same message: sequentially, 3x at the same moment (race), and while the first copy is still processing
- Webhook acknowledged fast enough (slow acks trigger more retries)
- One webhook carrying several messages / users

**Crashes**
- Status webhooks (sent / delivered / read / failed) get no reply and no 5xx
- Malformed and unexpected payloads, then the bot still works
- Buttons, list replies, template quick replies, images, voice notes, documents, stickers, locations, contacts, reactions, unsupported types
- 4,090-character messages with emoji (4,096 limit on replies)

**Security and privacy**
- Forged requests: missing, wrong or tampered X-Hub-Signature-256
- Webhook verification handshake refuses a wrong verify token
- Two customers at once: no data leaks to the wrong person

**Graph API errors**
- Rate limit (130429), then recovery
- Permanent send errors (131026) without a retry storm
- Asynchronous failed status (131047, 24-hour window)

**Conversation policies (optional)**
- Handoff to a human: the bot stays quiet afterwards
- Stale replays and message bursts

Plus `references/fixes.md`: fix patterns for Node.js, Python and Go (idempotency with Redis SET NX / Postgres ON CONFLICT, enqueue-then-ack, signature verification, retry tables by error code, handoff state).

### How it works
1. Your agent reads your bot and finds the webhook route and the Graph API send path.
2. It proposes the smallest change to point the Graph base URL at the local mock (applied only with your OK) and uses test secrets.
3. It runs the lab and writes `wa-lab-report/report.md` and `report.json`.
4. It explains every FAIL with evidence and offers fixes, then re-runs to confirm.

### Safe by design
- Zero dependencies, Node.js 22+. No network calls except to your local bot and the lab's own loopback mock.
- Refuses non-local webhook URLs unless you pass `--allow-remote` for a test deployment you control.
- Secrets are redacted from reports. All generated phone numbers are fictional 1555… numbers.
- Results are PASS / FAIL / WARN / INCONCLUSIVE / SKIP: the lab never reports a pass it could not observe.
- CI-friendly exit codes.

### Free vs Pro
A free edition with 6 core checks is open source on GitHub (github.com/Keanw234412/whatsapp-bot-failure-lab). Pro adds the 14 scenarios above that catch races, forged requests, cross-customer leaks, Graph API error handling and non-text crashes, plus the fix patterns.

## Requires

- Node.js
- WhatsApp Cloud API bot that runs locally

## Known limitations

No support for Baileys, whatsmeow, or third-party gateways. Requires Node.js 22+ for the test harness. Mocking requires the bot to support a configurable Graph API base URL.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the WhatsApp Bot Failure Lab Pro: Pre-Launch Bug Finder skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it send real WhatsApp messages?

No, as long as your bot's send paths point at the local mock and it runs with test credentials. The lab itself only talks to your local bot and its own loopback mock, and refuses non-local URLs by default.

### Which language does my bot need to be written in?

Any. The lab talks HTTP to your bot. references/setup.md shows how to make the Graph base URL configurable in Node.js, Python and Go.

### Does it work with Baileys, whatsmeow or whatsapp-web.js?

Not yet. This version supports the official WhatsApp Cloud API (Meta webhooks + Graph API) only.

### My bot uses an LLM, so replies vary. Will checks be flaky?

The lab compares reply counts, recipients, order codes and timing, not wording. When it cannot observe enough it reports INCONCLUSIVE instead of guessing.

### Can I run it in CI?

Yes. The config can start and stop your bot, and the exit code is non-zero when a scenario fails (add --strict to also fail on WARN/INCONCLUSIVE).

### What is the difference with the free GitHub version?

The free version has 6 core checks. Pro adds 14 scenarios (races, forged signatures, cross-customer leaks, Graph error handling, non-text crashes, handoff, stale/burst policies) and fix patterns for Node.js, Python and Go.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
