Repository navigation
Description
Summary
When a Telegram group message triggers an agent session (via channels.telegram.groups binding), the agent generates a correct response but the response is delivered to the webchat Control UI session instead of back to the Telegram group. This is a regression — explicit message tool sends work correctly.
Secret word: lobster-biscuit
Repro Steps
- Open the OpenClaw Control UI (webchat) in a browser
- Navigate to a Telegram group session (
agent:main:telegram:group:-1003711962889:topic:1) - Send a message from that Telegram group
- The agent receives the message (visible in session transcript)
- The agent generates a response
- Response appears in webchat instead of in the Telegram group
Alternatively:
- Send a message directly from Telegram to the group
- Agent receives it (confirmed in session transcript)
- Response is generated
- Response goes to webchat, not Telegram
Expected
Agent responses in a Telegram group session should be delivered to the Telegram group via deliveryContext: { channel: "telegram", to: "telegram:-1003711962889", threadId: 1 }.
Actual
Response goes to webchat. Session shows:
origin: { provider: "webchat", accountId: "default" }
deliveryContext: { channel: "telegram", to: "telegram:-1003711962889", threadId: 1 }
The origin.provider === "webchat" appears to override the Telegram deliveryContext for response routing.
Environment
- OpenClaw: 2026.5.3-1
- Node: v25.6.0
- OS: Linux 6.18.7-surface-1 (x64)
- Gateway: running on port 18789 (loopback)
- Model: minimax/minimax-m2.7
Affected channels: Telegram group sessions (both default account and ami account)
Channels NOT affected: Direct Telegram DMs appear to work correctly (responses route to Telegram)
Logs/Evidence
Session list shows correct Telegram delivery context:
key: agent:main:telegram:group:-1003711962889:topic:1
deliveryContext: { channel: "telegram", to: "telegram:-1003711962889", threadId: 1 }
origin: { provider: "webchat", accountId: "default" } // <-- likely culprit
lastChannel: "telegram"
lastTo: "telegram:-1003711962889"
The ami bot shows the same pattern:
- Session receives messages correctly (
agent:ami:telegram:group:-1003965142290:topic:1) - Generates responses correctly (transcript confirms model completed at 23:04:53)
- Response goes to webchat instead of Telegram group
Explicit message(action=send, channel=telegram, target="-1003711962889") works correctly — responses do reach Telegram when sent via tool explicitly.
Impact
High. All Telegram group communication is broken for sessions accessed via Control UI webchat. Workaround of explicit message tool sends is functional but loses the natural conversational flow. Two separate users reported identical issue after updating to 2026.5.3-1.
Workarounds
- Use explicit
message(action=send, channel=telegram, target="-1003711962889")for all group responses - Access the Telegram group session directly (not via webchat Control UI) — but if webchat is open, responses still go to webchat
- Use Telegram Direct Messages instead of groups
Regression
Issue appeared after updating to 2026.5.3-1 (was working before on 2026.4.x). The origin.provider === "webchat" override was likely introduced or changed in this version.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 4, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Close: current main and shipped release v2026.6.6 already prefer explicit external delivery context over stale WebChat/internal route fields, with focused regression coverage and merged-fix provenance.
I found the merged PR that appears to have closed this: #87476: [Fix] Prefer external session delivery context.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep PR 87476’s shipped resolver behavior as canonical, and handle distinct Telegram sendMessage/account failures separately rather than reopening this stale WebChat-origin route bug.
Do we have a high-confidence way to reproduce the issue?
No, not as a failing current-main bug. The issue body and comments provide a high-confidence shipped-version repro, and current main now has a regression test proving that stale WebChat fields no longer override external deliveryContext.
Is this the best way to solve the issue?
Yes. The merged fix changes the shared delivery-context resolver, which is the narrow owner boundary used by session delivery lookup, while preserving WebChat/internal route safety with regression coverage.
Security review:
Security review: No patch is under review; this is an ordinary channel/session routing issue with no security-sensitive report.
AGENTS.md: found and applied where relevant.
What I checked:
AGENTS.md:11, 6134c00657a2)src/utils/delivery-context.shared.ts:173, 6134c00657a2)src/utils/delivery-context.test.ts:178, 6134c00657a2)src/config/sessions/delivery-info.ts:65, 6134c00657a2)src/utils/delivery-context.shared.ts:149, c237de552ac3)Likely related people:
src/utils/delivery-context.shared.ts,src/utils/delivery-context.test.ts,src/gateway/server.sessions-send.test.ts)src/utils/delivery-context.shared.ts,src/utils/delivery-context.test.ts,src/gateway/server.sessions-send.test.ts)src/utils/delivery-context.shared.ts,src/utils/delivery-context.test.ts)Codex review notes: model internal, reasoning high; reviewed against 6134c00657a2; fix evidence: merged PR #87476, release v2026.6.6, commit c237de552ac3.
samivis commentedon May 5, 2026
Same root cause hits TUI/openclaw-tui inputs too — replies leak to whichever channel the session was originally anchored to instead of the channel the inbound message came in on.
Repro:
openclaw-tuiAffects v2026.5.3-1 on macOS (Darwin 24.1.0, Node v24.12.0). Looks like the same
origin.providervsdeliveryContextmismatch —deliveryContextshould win.leroylim commentedon May 6, 2026
Agreed. I have this problem on v2026.5.5 on macOS 26.4.1 as well. I downgraded back to v2026.4.29 as topics was no longer working, only direct chats were working.
When chatting with Telegram topics, I can see replies in the web dashboard but not in the Telegram topic.
cgbahk commentedon May 6, 2026
I was suffering same issue, (not sure) but adding this to
openclaw.jsonseems to resolve this (Tested on 2026.5.5 / 2026.5.4 / 2026.4.27)You guys may try too.
fmatray commentedon May 9, 2026
it doesn't work for me
pfrederiksen commentedon May 30, 2026
Closing as fixed upstream. Current main now preserves explicit external delivery context over stale WebChat/internal legacy fields, and the focused delivery-context regression passes on origin/main. Supersedes PR #77611.
pfrederiksen commentedon May 30, 2026
Fixed upstream; PR #77611 has been closed as superseded.\n\nEvidence checked on current origin/main:\n- explicit external delivery context is preferred over stale WebChat/internal legacy fields\n- focused regression passed:\n node scripts/test-projects.mjs src/utils/delivery-context.test.ts -- -t 'prefers explicit external delivery context over stale webchat legacy fields'\n\nI cannot close this issue from this token (GitHub returned CloseIssue permission denied), but it is ready to close.