Skip to content

Feature Request: message:received and message:sent hook events #5354

@noamabta-stellarfox

Description

@noamabta-stellarfox

Summary

Enable hooks to listen to message:received and message:sent events for automated chat logging and processing.

Use Case

I want to automatically log all incoming/outgoing messages to a file so the agent can recover context when it gets truncated mid-conversation. Currently these events are listed as "Future Events" in the hooks documentation but aren't implemented yet.

Current Workaround

Manual logging by the agent at the end of each turn - unreliable since the agent might forget or context gets cut before it can write.

Proposed Implementation

// hooks/chat-logger/index.js
module.exports = {
  events: ['message:received', 'message:sent'],
  async handler(event) {
    const { type, message, channel, timestamp } = event;
    // Append to log file
  }
};

Impact

This would significantly improve agent continuity and reduce frustration when context windows get truncated.

Thanks! 🎮

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions