#9859: feat(hooks): add message:transcribed and message:preprocessed internal hooks
docs
size: L
## Summary
Adds two new internal hook events that fire after media and link understanding:
### `message:transcribed`
Fires when audio has been fully transcribed. Provides the transcript text alongside the original body and media metadata. Useful for logging, analytics, or routing based on spoken content.
### `message:preprocessed`
Fires for every message after all media + link understanding completes — giving hooks access to the fully enriched body (transcripts, image descriptions, link summaries) before the agent sees it.
## Context
`message:received` and `message:sent` were backported by the upstream team in f07bb8e8 (merged Feb 17). This PR adds the two remaining hooks from the original set.
## Community
- 🙋 @j0nscalet has been waiting on `message:transcribed` for a voice-note logging integration
- ✅ @matskevich is running `message:preprocessed` in production on a fork and reports it stable
## Changes
- `src/auto-reply/reply/get-reply.ts` — triggers `message:transcribed` (audio only) and `message:preprocessed` (all messages) after `applyMediaUnderstanding` + `applyLinkUnderstanding`
- `src/hooks/internal-hooks.ts` — adds `MessageTranscribedHookContext`, `MessagePreprocessedHookContext`, and corresponding event types + type guards
- `src/hooks/message-hooks.test.ts` — new test file covering all four message event types
- `docs/automation/hooks.md` — documents all four message events and their contexts
- `src/config/types.hooks.ts` — updates comment to include new event keys
Most Similar PRs
#15577: feat(hooks): add message:preprocessed hook event
by heybeaux · 2026-02-13
79.6%
#19922: feat(hooks): add message:received and message:sent hook events
by NOVA-Openclaw · 2026-02-18
77.3%
#7545: feat(hooks): add message:received hook for pre-turn automation
by wangtian24 · 2026-02-02
74.3%
#7580: feat: add message:received internal hook with prompt injection
by rodrigoschott · 2026-02-03
73.9%
#11597: feat(hooks): implement message:received hook
by gnufoo · 2026-02-08
73.7%
#10706: feat(hooks): add message:received internal hook for Telegram
by thebtf · 2026-02-06
73.0%
#16618: feat: bridge message lifecycle hooks to workspace hook system
by DarlingtonDeveloper · 2026-02-14
72.2%
#19565: feat: add agent lifecycle hook events (session, message, error)
by tag-assistant · 2026-02-17
71.3%
#10109: feat(plugins): invoke message_received and message_sent hooks
by nezovskii · 2026-02-06
69.1%
#12986: feat(hooks): wire message_sending and message_sent plugin hooks
by Ramsbaby · 2026-02-10
68.9%