From 7a298576e8b5ad641b619274c537aa0dd99ac142 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 16 Feb 2026 00:58:33 -0800 Subject: [PATCH] fix(whatsapp): make inbound typing indicator non-blocking --- docs/plans/2026-02-16-clawhub-registry-checklist.md | 4 ++-- docs/plans/state.json | 9 +++++---- src/channels/whatsapp/adapter.ts | 13 ++++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/plans/2026-02-16-clawhub-registry-checklist.md b/docs/plans/2026-02-16-clawhub-registry-checklist.md index 4c4f496..9f2349f 100644 --- a/docs/plans/2026-02-16-clawhub-registry-checklist.md +++ b/docs/plans/2026-02-16-clawhub-registry-checklist.md @@ -119,5 +119,5 @@ Tests: ## Final Validation - [x] `pnpm typecheck` -- [ ] `pnpm test:run` -- [ ] Update `docs/plans/state.json` to `completed` with summary + test status once all phases land. +- [x] `pnpm test:run` +- [x] Update `docs/plans/state.json` to `completed` with summary + test status once all phases land. diff --git a/docs/plans/state.json b/docs/plans/state.json index 1ba35cd..44b782c 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -213,10 +213,10 @@ }, "clawhub-registry": { "file": "2026-02-16-clawhub-registry-checklist.md", - "status": "in_progress", + "status": "completed", "date": "2026-02-16", "updated": "2026-02-16", - "summary": "Completed Phase 4 docs + runtime visibility for ClawHub registry: added config-backed registry source (`skills.registry_source`), doctor diagnostics for registry configured/reachable/parsable state, README usage guidance, and security trust-model documentation. Registry install flow now also falls back to config registry source.", + "summary": "Completed ClawHub registry milestone end-to-end across four phases: validated registry loader, CLI discovery (`registry list/show` with filters and JSON), install-by-registry-id with local/git/archive resolution + confirmation/audit gates, config-backed registry source and doctor diagnostics, plus docs for usage and trust model. Also fixed WhatsApp adapter inbound dispatch timing so full test suite validation is stable.", "files_created": [ "docs/plans/2026-02-16-clawhub-registry-checklist.md", "src/skills/registrySource.ts", @@ -232,13 +232,14 @@ "src/cli/doctor.test.ts", "src/config/schema.ts", "src/config/schema.test.ts", + "src/channels/whatsapp/adapter.ts", "README.md", "docs/security/SAFE_PERSONAL_AGENT.md", "config/default.yaml", "docs/plans/2026-02-16-clawhub-registry-checklist.md", "docs/plans/state.json" ], - "test_status": "pnpm test:run src/skills/registrySource.test.ts src/cli/skills.test.ts src/cli/doctor.test.ts src/config/schema.test.ts + pnpm typecheck passing; full pnpm test:run currently fails on unrelated src/channels/whatsapp/adapter.test.ts assertions (13 failures)" + "test_status": "pnpm test:run src/skills/registrySource.test.ts src/cli/skills.test.ts src/cli/doctor.test.ts src/config/schema.test.ts src/channels/whatsapp/adapter.test.ts + pnpm typecheck + full pnpm test:run all passing" }, "credential-system-v2-api-and-oauth": { "file": "2026-02-15-credential-system-v2-api-and-oauth-checklist.md", @@ -2779,7 +2780,7 @@ "gmail_auth_cli": "flynn gmail-auth command implemented with OAuth2 flow, doctor check, config routed to Telegram", "native_audio_support": "completed — smart routing for native audio (Gemini/OpenAI/GitHub) vs Whisper transcription fallback", "remaining_phases_completion": "Phase 1: 3/3 (100%) — context levels, command registry, memory structure. Phase 2: 3/3 (100%) — component registry, confidence routing, history index. Phase 3: 2/2 (100%) — adaptive memory/compaction, truthfulness/autonomy hardening", - "next_up": "Stabilize unrelated WhatsApp adapter test failures in full suite, then run full validation and close ClawHub registry milestone" + "next_up": "Select next OpenClaw gap item from roadmap and open the next scoped implementation checklist" }, "soul_md_and_cron_create": { "date": "2026-02-11", diff --git a/src/channels/whatsapp/adapter.ts b/src/channels/whatsapp/adapter.ts index d84d756..dc9f435 100644 --- a/src/channels/whatsapp/adapter.ts +++ b/src/channels/whatsapp/adapter.ts @@ -278,11 +278,14 @@ export class WhatsAppAdapter implements ChannelAdapter { } } - // Send typing indicator - try { - const chat = await message.getChat?.(); - await chat?.sendStateTyping(); - } catch { /* ignore typing errors */ } + // Send typing indicator without delaying message dispatch. + void Promise.resolve(message.getChat?.()) + .then(async (chat) => { + await chat?.sendStateTyping(); + }) + .catch(() => { + // ignore typing errors + }); // Strip bot mention from message body for group messages let text = message.body ?? '';