Bug type
Behavior bug (incorrect output/state without crash)
Summary
Description
The message:sent internal hook event is never emitted when a bot delivers a message to a Telegram group (including forum topic chats). The message:received and message:preprocessed events fire correctly for the same conversations.
Steps to reproduce
- Register an internal hook listening for message:sent (via hooks/ directory + openclaw.json → hooks.internal.entries)
- Send a message to a Telegram group or forum topic (bot replies to a user message)
- Observe that message:sent never fires; message:received works fine
Root Cause
In deliver.ts → createMessageSentEmitter, the session key is resolved as:
sessionKeyForInternalHooks = params.mirror?.sessionKey ?? params.session?.key
When delivering to a Telegram group, both params.mirror?.sessionKey and params.session?.key are undefined. Without a valid session key, the emitter silently skips generating the message:sent event.
Expected behavior
[[[In deliver.ts → createMessageSentEmitter, the session key is resolved as:
sessionKeyForInternalHooks = params.mirror?.sessionKey ?? params.session?.key
When delivering to a Telegram group, both params.mirror?.sessionKey and params.session?.key are undefined. Without a valid session key, the emitter silently skips generating the message:sent event.](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)
Actual behavior
Workaround
Using send.sh scripts in cron jobs to manually duplicate messages to other platforms. No workaround exists for real-time bot replies in group chats.
OpenClaw version
• OpenClaw version: 2026.3.12
Operating system
ubuntu
Install method
No response
Model
claude opus
Provider / routing chain
Telegram (group/forum topics) → OpenClaw Gateway → deliver.ts → internal hooks
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
OpenClaw version: 2026.3.12
• Channel: Telegram (group + forum topics)
• Hook type: internal (hooks.internal.entries)
Additional information
Workaround
Using send.sh scripts in cron jobs to manually duplicate messages to other platforms. No workaround exists for real-time bot replies in group chats.
Bug type
Behavior bug (incorrect output/state without crash)
Summary
Description
The message:sent internal hook event is never emitted when a bot delivers a message to a Telegram group (including forum topic chats). The message:received and message:preprocessed events fire correctly for the same conversations.
Steps to reproduce
Root Cause
In deliver.ts → createMessageSentEmitter, the session key is resolved as:
sessionKeyForInternalHooks = params.mirror?.sessionKey ?? params.session?.key
When delivering to a Telegram group, both params.mirror?.sessionKey and params.session?.key are undefined. Without a valid session key, the emitter silently skips generating the message:sent event.
Expected behavior
[[[In deliver.ts → createMessageSentEmitter, the session key is resolved as:
sessionKeyForInternalHooks = params.mirror?.sessionKey ?? params.session?.key
When delivering to a Telegram group, both params.mirror?.sessionKey and params.session?.key are undefined. Without a valid session key, the emitter silently skips generating the message:sent event.](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)](message:sent should fire for all outbound messages regardless of delivery target (DM, group, forum topic). If sessionKey is unavailable, the event should still be emitted with alternative identifiers (e.g., conversationId, chatId).)
Actual behavior
Workaround
Using send.sh scripts in cron jobs to manually duplicate messages to other platforms. No workaround exists for real-time bot replies in group chats.
OpenClaw version
• OpenClaw version: 2026.3.12
Operating system
ubuntu
Install method
No response
Model
claude opus
Provider / routing chain
Telegram (group/forum topics) → OpenClaw Gateway → deliver.ts → internal hooks
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
OpenClaw version: 2026.3.12
• Channel: Telegram (group + forum topics)
• Hook type: internal (hooks.internal.entries)
Additional information
Workaround
Using send.sh scripts in cron jobs to manually duplicate messages to other platforms. No workaround exists for real-time bot replies in group chats.