← Back to PRs

#9859: feat(hooks): add message:transcribed and message:preprocessed internal hooks

by Drickon open 2026-02-05 19:32 View on GitHub →
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