-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Feature]: Support ACP configured bindings for Telegram DMs (not just groups/topics) #62769
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Telegram ACP configured bindings (
bindings[]withtype: "acp") only work for group chats and forum topics, not for direct messages (DMs). This prevents using persistent ACP sessions in Telegram DM conversations with dedicated agent bots.Root Cause
In
normalizeTelegramAcpConversationId(), the function explicitly rejects anychatIdthat does not start with"-"(i.e., group chat IDs):This means DM peer IDs (positive integers like
6689123501) are filtered out, and the binding is silently ignored.Similarly,
matchTelegramAcpConversation()checksincoming.chatId.startsWith("-"), which also rejects DM conversations.Expected Behavior
A configured binding like this should work for Telegram DMs:
{ "type": "acp", "agentId": "claude", "match": { "channel": "telegram", "accountId": "claude", "peer": { "kind": "direct", "id": "6689123501" } }, "acp": { "mode": "persistent" } }When a user sends a message to the dedicated agent bot in DM, it should route through the ACP binding and create/resume an ACP harness session, just like it does for group topics.
Actual Behavior
openclaw config validate✅normalizeTelegramAcpConversationId()returnsnullfor DM peer IDsUse Case
We run dedicated Telegram bots for different ACP agents (Claude Code, Codex, etc.). Each bot has its own
accountId. Users DM these bots expecting to interact with the actual ACP harness (e.g., Claude Code CLI). Without DM binding support, there is no way to persistently bind a Telegram DM conversation to an ACP session through config.Currently, the only workaround is
/acp spawnin a group topic, which defeats the purpose of having dedicated DM bots.Additional Context
sessions.json, making the DM → ACP routing even less reliableagents.list[].runtime.type: "acp"does NOT automatically route DM messages through ACP — it only provides defaults for/acp spawnacpManager.resolveSession()check inagentCommandInternal()returnskind: "none"for DM sessions without.acpmetadata, falling through to native embedded runtimeEnvironment