Skip to content

Fix Telegram /activation command and improve group docs#377

Closed
julianengel wants to merge 5 commits intoopenclaw:mainfrom
julianengel:fix/telegram-groups-activation
Closed

Fix Telegram /activation command and improve group docs#377
julianengel wants to merge 5 commits intoopenclaw:mainfrom
julianengel:fix/telegram-groups-activation

Conversation

@julianengel
Copy link
Copy Markdown
Contributor

Fix Telegram group activation and improve documentation

Problem

  1. /activation always command appeared to work but had no effect
  2. Documentation didn't clearly explain group access control
  3. Users confused about telegram.groups creating an allowlist
  4. allowFrom file was incorrectly used for groups

Root Cause

  • Bot filtered messages based on config requireMention setting only
  • Session state (updated by /activation) was never consulted
  • This created a broken UX where the command seemed to succeed but didn't work

Solution

Code Fix (src/telegram/bot.ts)

  • Load session state early to check groupActivation field
  • Check session state before falling back to config
  • Makes /activation always and /activation mention commands actually work
  • Respects forum topics by including messageThreadId in session key

Documentation (docs/providers/telegram.md)

  • Add detailed "Group activation modes" section
  • Clarify two-level access control:
  1. Group allowlist (telegram.groups)
  2. Sender filtering (telegram.groupPolicy)
  • Document /activation command properly
  • Add troubleshooting section with common issues
  • Explain how to get group chat ID

Testing

  • x Group with requireMention: false in config responds to all messages
  • x /activation always enables always-respond mode
  • x /activation mention enables mention-only mode
  • x Settings persist across gateway restarts (stored in session)
  • x Wildcard "*" in telegram.groups works correctly
  • x Group not in allowlist is blocked when groups config exists

Migration Impact

  • Backwards compatible: Existing behavior
  • unchanged
  • /activation command that was broken will now work
  • No config changes required

- Add detailed explanation of group activation modes (requireMention)
- Document /activation command (mention vs always)
- Clarify two-level access control: group allowlist + sender policy
- Add troubleshooting section for common issues
- Explain that telegram.groups creates an allowlist
- Add instructions for getting group chat ID

Fixes confusion around group setup where /activation command
updates session state but doesn't persist or take effect.
The /activation command now properly controls group activation mode:
- Loads session state before filtering messages
- Checks groupActivation field (from /activation command)
- Falls back to config telegram.groups requireMention setting

Previously, the bot only checked config and ignored session state,
making the /activation command appear to work but have no effect.

Changes:
- Add resolveGroupActivation() to check session before config
- Import loadSessionStore to read session state early
- Pass messageThreadId to support forum topics correctly
@steipete steipete self-assigned this Jan 7, 2026
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 7, 2026

Landed on main. Applied activation/session changes + docs + tests; added changelog entry; ran full gate (lint/build/test/docs).

Commits:

  • 1601be5 docs(telegram): clarify group activation and access control
  • 45dc4ef fix(telegram): make /activation command work by checking session state
  • 3cbced0 test(telegram): cover routed activation
  • 4bd7ca3 fix(telegram): honor session activation overrides
  • 53c037a style(telegram): format activation log

@steipete steipete closed this Jan 7, 2026
dgarson added a commit to dgarson/clawdbot that referenced this pull request Feb 9, 2026
openclaw#377)

* Web: replace mock domain data

* Web: honor overseer goal status
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