Skip to content

Conversation

@bohdanpodvirnyi
Copy link
Contributor

Summary

Adds bidirectional Telegram reaction support: users' reactions are now visible to Clawdbot via system events, and Clawdbot can react to messages with configurable behavior levels.

Changes

Reaction Notifications (User → Agent)

  • New config: channels.telegram.reactionNotifications controls visibility
    • "off" — ignore all reactions (default)
    • "all" — notify agent of all reactions
  • Telegram message_reaction events convert to system events with format: "Telegram reaction added: {emoji} by {user} on msg {id}"
  • Events enqueue using the same session key as messages (including forum thread support)
  • System events drain on next message, appearing in conversation history

Agent Reactions (Agent → User)

  • New config: channels.telegram.reactionLevel controls agent capability
    • "off" — agent cannot react
    • "ack" — bot sends acknowledgment reactions (👀 while processing)
    • "minimal" — agent can react sparingly (guideline: 1 per 5-10 exchanges)
    • "extensive" — agent can react liberally
  • System prompt includes reaction guidance based on level
  • Tool gating checks both reactionLevel and existing actions.reactions

Infrastructure

  • Sent message cache (src/telegram/sent-message-cache.ts): tracks bot's own messages to distinguish from user messages
  • Reaction level resolver (src/telegram/reaction-level.ts): determines effective capabilities and guidance
  • Forum group support: reactions include message_thread_id for correct session routing

Documentation

  • Added comprehensive reaction section to docs/channels/telegram.md
  • Explains how reactions flow through system events
  • Configuration examples for common use cases
  • Notes on Telegram API requirements (allowed_updates)

Test Coverage

  • Unit tests:
    • src/telegram/bot.test.ts — 80+ new test cases for reaction event handling
    • src/telegram/reaction-level.test.ts — reaction level resolution logic
    • src/telegram/sent-message-cache.test.ts — message tracking
    • src/agents/tools/telegram-actions.test.ts — updated for reaction level gating
  • Coverage: All new code paths covered

Migration Notes

  • Backward compatible: both configs default to restrictive behavior
  • Existing actions.reactions gating still respected
  • No changes required to existing configurations

🤖 Generated with Claude Code

@steipete steipete self-assigned this Jan 15, 2026
@bohdanpodvirnyi bohdanpodvirnyi force-pushed the feat/telegram-reactions branch from b10aa7f to faedcf8 Compare January 15, 2026 17:02
@steipete steipete force-pushed the feat/telegram-reactions branch from faedcf8 to 2b1c26f Compare January 15, 2026 17:21
@steipete steipete merged commit b6fb24f into openclaw:main Jan 15, 2026
33 of 42 checks passed
@steipete
Copy link
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: 2b1c26f
  • Merge commit: b6fb24f

Thanks @bohdanpodvirnyi!

michaelhaessig pushed a commit to michaelhaessig/clawdbot that referenced this pull request Jan 15, 2026
cpojer pushed a commit to cpojer/clawdbot that referenced this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants