Summary
When dmScope: "per-channel-peer" is enabled, Telegram DM sessions show incorrect metadata with channel: "webchat" instead of "telegram", despite correct routing behavior.
Environment
- OpenClaw Version: 2026.2.3-1
- OS: macOS (Darwin 25.2.0, arm64)
- Node: v25.6.0
- Channel: Telegram
- Config:
session.dmScope: "per-channel-peer" enabled
Evidence
Session metadata from sessions_list:
{
"key": "agent:main:telegram:dm:6695119663",
"displayName": "webchat:g-agent-main-telegram-dm-6695119663",
"channel": "webchat",
"deliveryContext": {
"channel": "telegram",
"to": "telegram:6695119663"
},
"lastChannel": "telegram"
}
Observed:
metadata.channel shows "webchat" ❌
displayName shows "webchat:g-agent-main-telegram-dm-6695119663" ❌
Expected:
metadata.channel should show "telegram" ✅
displayName should follow proper Telegram format ✅
Correct:
deliveryContext.channel shows "telegram" ✅
lastChannel shows "telegram" ✅
- Session key correctly includes
telegram:dm ✅
Steps to Reproduce
- Enable secure DM mode:
session.dmScope: "per-channel-peer"
- Restart gateway
- Receive message from Telegram DM
- Run
sessions_list or check session metadata
- Observe
channel field shows "webchat" instead of "telegram"
Impact
- Display confusion: Session appears mislabeled in UI/logs
- Potential routing issues: Could contribute to session identification errors
- Debugging difficulty: Makes it harder to track which channel a session belongs to
Actual Behavior
Messages route correctly (deliveryContext is accurate), but session metadata labels the channel incorrectly.
Related Issues
Possibly related to:
Notes
This occurred immediately after enabling dmScope: "per-channel-peer" and restarting the gateway. The session functions correctly (messages deliver properly), but the metadata mislabeling could contribute to confusion in multi-channel scenarios.
Summary
When
dmScope: "per-channel-peer"is enabled, Telegram DM sessions show incorrect metadata withchannel: "webchat"instead of"telegram", despite correct routing behavior.Environment
session.dmScope: "per-channel-peer"enabledEvidence
Session metadata from
sessions_list:{ "key": "agent:main:telegram:dm:6695119663", "displayName": "webchat:g-agent-main-telegram-dm-6695119663", "channel": "webchat", "deliveryContext": { "channel": "telegram", "to": "telegram:6695119663" }, "lastChannel": "telegram" }Observed:
metadata.channelshows"webchat"❌displayNameshows"webchat:g-agent-main-telegram-dm-6695119663"❌Expected:
metadata.channelshould show"telegram"✅displayNameshould follow proper Telegram format ✅Correct:
deliveryContext.channelshows"telegram"✅lastChannelshows"telegram"✅telegram:dm✅Steps to Reproduce
session.dmScope: "per-channel-peer"sessions_listor check session metadatachannelfield shows"webchat"instead of"telegram"Impact
Actual Behavior
Messages route correctly (deliveryContext is accurate), but session metadata labels the channel incorrectly.
Related Issues
Possibly related to:
Notes
This occurred immediately after enabling
dmScope: "per-channel-peer"and restarting the gateway. The session functions correctly (messages deliver properly), but the metadata mislabeling could contribute to confusion in multi-channel scenarios.