-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Closed
Description
Summary
I'm building a plugin for real-time message sync to an external database (Convex) and discovered that while OpenClaw has the infrastructure for message hooks, they're not fully exposed to the Plugin API.
Current State
Hooks defined but not called:
message_sent- defined insrc/plugins/types.tsbut never calledmessage_received- defined but never called
Internal events not exposed:
onSessionTranscriptUpdateinsrc/sessions/transcript-events.ts- fires when transcripts update but not accessible to plugins
Callbacks exist but internal only:
onPayloadcallback indeliverOutboundPayloads()- called before sending but not exposed
Proposal
Please consider one of:
-
Implement the existing message hooks: Call
runMessageSent()andrunMessageReceived()in the appropriate places so plugins can register for these events -
Expose transcript events: Add
api.runtime.transcriptEvents.onSessionTranscriptUpdate()to the Plugin API -
Add delivery callbacks to Plugin API: Allow plugins to register for
onPayloadcallbacks in the delivery flow
Use Cases
- Real-time message archival to external databases
- Message logging/auditing
- External integrations that need to react to messages
- Memory/RAG systems that need to capture conversations
Research
I used Nia to trace the codebase and found:
src/infra/outbound/deliver.tshasonPayloadcallback at line 276src/sessions/transcript-events.tshas the event systemsrc/plugins/hooks.tshasrunMessageSent()defined but no callers
Would love to help implement if pointed in the right direction!
/cc @openclaw team
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels