-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When multiple Telegram bot accounts are configured under channels.telegram.accounts, message delivery after a gateway restart is routed through whichever bot connects first, not the bot associated with the originating session.
Steps to Reproduce
- Configure 3+ Telegram bot accounts (e.g.,
agent_a,agent_b,agent_c) each bound to a different agent viabindings - Have an active session on one account (e.g.,
agent_a→ agentmain) - Apply a config patch that triggers a gateway restart (
config.patch) - The queued/pending response from the
mainagent is delivered through the wrong bot (e.g.,agent_b)
Expected Behavior
After restart, message delivery should wait until the correct Telegram bot account is connected before delivering. The delivery context (session → agent → binding → account) should be fully resolved before any message is sent.
Actual Behavior
- Bots appear to start in alphabetical order by account key
- During startup,
sessionKey=unknownis logged, indicating the session-to-account mapping is not yet resolved - The pending response is delivered through whichever bot connects first
- This causes messages from Agent A to appear in Agent B's Telegram chat with the user
Evidence from Logs
16:35:14.081 [agent_b] starting provider (@agent_b_bot)
16:35:14.191 session state: sessionId=<redacted> sessionKey=unknown ← key not resolved
16:35:14.511 [agent_a] starting provider (@agent_a_bot)
16:35:23.100 [message delivered — went through agent_b instead of agent_a]
Impact
This is a data isolation / privacy issue in multi-agent setups. If agents have different access levels or serve different purposes, messages from one agent appearing in another agent's channel is a trust and privacy breach.
Root Cause & Fix
See comment below.
Environment
- OpenClaw version: 2026.1.24-3
- OS: macOS 26.2 (arm64)
- Node: v25.5.0
- Telegram accounts: 3
- Agents: 5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working