-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Description
Problem
The Telegram adapter (src/messaging/telegram.rs) does not support slash commands like /top, /help, etc. All messages, including those starting with /, are treated as regular conversational input.
Current behavior
All inbound Telegram messages are routed as plain conversation regardless of content. There is no mechanism to map a Telegram command (e.g. /ask) to a specific agent ID.
Expected behavior
Telegram should support slash commands similar to the Slack adapter, allowing operators to configure command → agent_id mappings in config.
Reference: Slack implementation
The Slack adapter (src/messaging/slack.rs) already has this feature:
- Maintains a
commands: Arc<HashMap<String, String>>map (command string → agent_id) - Accepts
Vec<SlackCommandConfig>at construction time to populate the map - Has a dedicated
handle_command_eventhandler that:- Validates workspace/channel permissions
- Looks up the configured agent for the command
- Enqueues an
InboundMessagewithslack_commandandslack_command_agent_idmetadata for downstream routing
Suggested approach
Mirror the Slack pattern for Telegram:
- Add a
TelegramCommandConfig(or reuse a shared type) withcommand+agent_idfields - Add a
commands: Arc<HashMap<String, String>>field toTelegramAdapter - In the inbound polling loop, detect messages whose text starts with
/and look up a matching command entry - If found, enqueue with the appropriate agent routing metadata; otherwise fall through to normal conversation handling
Environment
- Adapter:
src/messaging/telegram.rs - Compared against:
src/messaging/slack.rs(lines 43–45, 378–521)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels