-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Description
Problem
Workspace hooks (HOOK.md-based, registered via hooks.internal) can only receive command:* events through triggerInternalHook. The message_received event is only dispatched through the Plugin Hook Runner (typedHooks / createHookRunner), making it inaccessible to workspace hooks.
Use Case
We built a graph-session workspace hook that manages Neo4j session nodes. It works great for command:new (close old session, create new one). But we also want to track message counts and detect inactivity (>2h) on every incoming message — which requires message_received.
Currently the only workaround is building a full plugin, which is heavier than a simple workspace hook.
Proposed Solution
Add a one-liner bridge in dispatch-from-config.js (or the hook runner) that also calls triggerInternalHook for message_received events, so workspace hooks can subscribe to them via HOOK.md events: ["message_received"].
Something like:
// After hookRunner.runMessageReceived(...)
triggerInternalHook({ type: "message", action: "received", context: { from, content, metadata } });This would make the workspace hook system much more powerful without breaking anything.
Environment
- Clawdbot 2026.1.24-3
- macOS, Neo4j workspace hooks