backfill_history
Recover missed WhatsApp messages from chats that were active while the bridge was offline by requesting older message history from WhatsApp's sync, returning the number of messages added and per-chat request info.
Instructions
Try to recover WhatsApp messages missed while the bridge was offline (e.g. you didn't open Cowork for a few days, leaving a gap in the history). For each of the most recently active chats it asks WhatsApp's on-demand history sync (Baileys fetchMessageHistory) for older messages, anchored at the newest cached message in that chat. Results arrive asynchronously and are cached. IMPORTANT: how far back WhatsApp actually serves is decided by WhatsApp, not us - run this to find out empirically for this account. Returns cacheBefore/cacheAfter (messagesAdded) and per-chat request info. If messagesAdded is ~0, WhatsApp didn't serve more for those anchors; a fresh re-link (relink_whatsapp) is the fuller-history fallback.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chats | No | How many recently-active chats to backfill. | |
| count | No | Messages to request per chat (older than that chat's newest cached message). | |
| chatId | No | Limit to one chat (its raw JID). Overrides `chats`. | |
| settleMs | No | How long to wait for async history to land before reporting messagesAdded. |