Bug Description
The MessageChannel tool adds extra quotes around the chat_id parameter when sending messages to Telegram, causing a No route for chat_id error. The error message shows ""<chat_id>"" instead of "<chat_id>".
Steps to Reproduce
- Set up a Telegram channel with Letta Code (desktop app v0.24.13 on macOS)
- Configure routing and accounts in
~/.letta/channels/telegram/
- Receive a message from Telegram (works fine — messages arrive via channel-notification)
- Try to reply using the MessageChannel tool:
MessageChannel(action="send", channel="telegram", chat_id="<numeric_chat_id>", message="Hello")
- Error:
No route for chat_id ""<numeric_chat_id>"" on "telegram" for this agent/conversation.
Expected Behavior
The MessageChannel tool should pass chat_id as "<numeric_chat_id>" to the routing system, matching the route configured in routing.yaml.
Actual Behavior
The chat_id gets double-quoted somewhere in the tool → routing pipeline, resulting in ""<numeric_chat_id>"", which doesn't match any route.
Workaround
Sending messages directly via the Telegram Bot API (curl to sendMessage endpoint) works correctly with the same chat_id.
Environment
- Letta Code: 0.24.13 (desktop app on macOS)
- Channel: Telegram
- Config:
dmPolicy: "allowlist", allowedUsers: ["<numeric_chat_id>"], routing.yaml has chatId: "<numeric_chat_id>"
- The route exists and is enabled — inbound messages work fine, only outbound via MessageChannel fails
Additional Context
The routing config is correct. The issue is specifically in how the MessageChannel tool serializes/passes the chat_id parameter to the routing lookup. This appears to be a string quoting/escaping bug in the tool implementation.
Related: PR #1737 (channels system with Telegram MVP), PR #1763 (Slack adapter and target binding — modified MessageChannel.ts)
Bug Description
The
MessageChanneltool adds extra quotes around thechat_idparameter when sending messages to Telegram, causing aNo route for chat_iderror. The error message shows""<chat_id>""instead of"<chat_id>".Steps to Reproduce
~/.letta/channels/telegram/No route for chat_id ""<numeric_chat_id>"" on "telegram" for this agent/conversation.Expected Behavior
The MessageChannel tool should pass
chat_idas"<numeric_chat_id>"to the routing system, matching the route configured inrouting.yaml.Actual Behavior
The
chat_idgets double-quoted somewhere in the tool → routing pipeline, resulting in""<numeric_chat_id>"", which doesn't match any route.Workaround
Sending messages directly via the Telegram Bot API (curl to
sendMessageendpoint) works correctly with the samechat_id.Environment
dmPolicy: "allowlist",allowedUsers: ["<numeric_chat_id>"],routing.yamlhaschatId: "<numeric_chat_id>"Additional Context
The routing config is correct. The issue is specifically in how the MessageChannel tool serializes/passes the
chat_idparameter to the routing lookup. This appears to be a string quoting/escaping bug in the tool implementation.Related: PR #1737 (channels system with Telegram MVP), PR #1763 (Slack adapter and target binding — modified MessageChannel.ts)