Skip to content

Commit 8dad90f

Browse files
danashburnclaude
andcommitted
fix: add watchdog to ResolvedWhatsAppAccount + docs precedence + oxfmt
CI feedback addressed: 1. `check-prod-types`, `check-test-types`, `check-additional-extension-*`, `checks-fast-contracts-channels-a`, `checks-node-agentic-control-plane-startup-health-runtime`: all blocked on `TS2339: Property 'watchdog' does not exist on type 'ResolvedWhatsAppAccount'` at `extensions/whatsapp/src/channel.ts:322`. `ResolvedWhatsAppAccount` is the parallel static type (lives in `accounts.ts`, listing every field flowing from `WhatsAppAccountConfig` to the runtime) — added `watchdog?: WhatsAppAccountConfig["watchdog"]` field + resolver return. 2. `check-docs` (oxfmt): missing trailing blank line after the JSON5 example. Ran `oxfmt --write` to auto-fix. 3. byungskers's docs review question — added explicit precedence note: per-account values override the channel-level default (same as `dmHistoryLimit` / `mediaMaxMb` / other common keys), so operators can ship a global default and override one noisy account. Real-behavior-proof gate (separate workflow) requires after-fix evidence from a real OpenClaw setup in the PR body — adding that as a follow-up edit to the PR body. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent bc51893 commit 8dad90f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎docs/channels/whatsapp.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ handoff path over manual terminal capture.
165165
- Gateway owns the WhatsApp socket and reconnect loop.
166166
- The reconnect watchdog uses WhatsApp Web transport activity, not only inbound app-message volume, so a quiet linked-device session is not restarted solely because nobody has sent a message recently. A longer application-silence cap still forces a reconnect if transport frames keep arriving but no application messages are handled for the watchdog window; after a transient reconnect for a recently active session, that application-silence check uses the normal message timeout for the first recovery window.
167167
- Baileys socket timings are explicit under `web.whatsapp.*`: `keepAliveIntervalMs` controls WhatsApp Web application pings, `connectTimeoutMs` controls the opening handshake timeout, and `defaultQueryTimeoutMs` controls Baileys query timeouts.
168-
- Reconnect watchdog tuning is explicit under `channels.whatsapp.watchdog.*` (or per-account at `channels.whatsapp.accounts.<id>.watchdog.*`): `messageTimeoutMs` is the app-silence cap (default 1_800_000), `transportTimeoutMs` is the WebSocket-silence cap (default 300_000), `watchdogCheckMs` is the evaluation interval (default 60_000). Raise `messageTimeoutMs` for use patterns with hour-long idle gaps between user-initiated turns; the WebSocket-level `transportTimeoutMs` still catches actually dead connections fast.
168+
- Reconnect watchdog tuning is explicit under `channels.whatsapp.watchdog.*` (or per-account at `channels.whatsapp.accounts.<id>.watchdog.*`): `messageTimeoutMs` is the app-silence cap (default 1_800_000), `transportTimeoutMs` is the WebSocket-silence cap (default 300_000), `watchdogCheckMs` is the evaluation interval (default 60_000). Raise `messageTimeoutMs` for use patterns with hour-long idle gaps between user-initiated turns; the WebSocket-level `transportTimeoutMs` still catches actually dead connections fast. Per-account values override the channel-level default (same precedence as `dmHistoryLimit`, `mediaMaxMb`, and the other common keys), so you can ship a global default and tighten or loosen a single noisy account independently.
169169

170170
```json5
171171
{
@@ -178,6 +178,7 @@ handoff path over manual terminal capture.
178178
},
179179
}
180180
```
181+
181182
- Outbound sends require an active WhatsApp listener for the target account.
182183
- Group sends attach native mention metadata for `@+<digits>` and `@<digits>` tokens in text and media captions when the token matches current WhatsApp participant metadata, including LID-backed groups.
183184
- Status and broadcast chats are ignored (`@status`, `@broadcast`).

‎extensions/whatsapp/src/accounts.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type ResolvedWhatsAppAccount = {
4646
direct?: WhatsAppAccountConfig["direct"];
4747
debounceMs?: number;
4848
replyToMode?: ReplyToMode;
49+
watchdog?: WhatsAppAccountConfig["watchdog"];
4950
};
5051

5152
export const DEFAULT_WHATSAPP_MEDIA_MAX_MB = 50;
@@ -154,6 +155,7 @@ export function resolveWhatsAppAccount(params: {
154155
direct: merged.direct,
155156
debounceMs: merged.debounceMs,
156157
replyToMode: merged.replyToMode,
158+
watchdog: merged.watchdog,
157159
};
158160
}
159161

0 commit comments

Comments
 (0)