Skip to content

Feature Request: Bridge message_received to internal hooks system (workspace hooks) #7067

@agentmorpheus77

Description

@agentmorpheus77

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions