fix(whatsapp): make inbound typing indicator non-blocking

This commit is contained in:
William Valentin
2026-02-16 00:58:33 -08:00
parent ae36248da8
commit 7a298576e8
3 changed files with 15 additions and 11 deletions
@@ -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.
+5 -4
View File
@@ -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",
+8 -5
View File
@@ -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 ?? '';