Skip to content

[Regression] Telegram group session responses route to webchat instead of back to Telegram (v2026.5.3-1) #77576

Closed

Description

@Childrenic

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

  1. Open the OpenClaw Control UI (webchat) in a browser
  2. Navigate to a Telegram group session (agent:main:telegram:group:-1003711962889:topic:1)
  3. Send a message from that Telegram group
  4. The agent receives the message (visible in session transcript)
  5. The agent generates a response
  6. Response appears in webchat instead of in the Telegram group

Alternatively:

  1. Send a message directly from Telegram to the group
  2. Agent receives it (confirmed in session transcript)
  3. Response is generated
  4. 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

  1. Use explicit message(action=send, channel=telegram, target="-1003711962889") for all group responses
  2. Access the Telegram group session directly (not via webchat Control UI) — but if webchat is open, responses still go to webchat
  3. 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.

Activity

  1. clawsweeper commented on May 4, 2026

    @clawsweeper
    Contributor

    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:

    Likely related people:

    • samzong: Authored the merged fix commit path for PR 87476, including the resolver change and regression coverage for stale WebChat route fields. (role: fix author; confidence: high; commits: 87dbe24730f0, c237de552ac3; files: src/utils/delivery-context.shared.ts, src/utils/delivery-context.test.ts, src/gateway/server.sessions-send.test.ts)
    • steipete: Merged PR 87476, co-authored the merge commit, and appears in recent history around session route projection and delivery-context refactors. (role: merger and recent route/session contributor; confidence: high; commits: c237de552ac3, 8477a67fafc6, 694ca50e9775; files: src/utils/delivery-context.shared.ts, src/utils/delivery-context.test.ts, src/gateway/server.sessions-send.test.ts)
    • vincentkoc: Recent path history shows delivery-context and message-channel normalization refactors adjacent to the fixed resolver and tests. (role: recent adjacent owner; confidence: medium; commits: e2524e043865, 2028fd53f077, b6abd68a2908; files: 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.

  2. samivis commented on May 5, 2026

    @samivis

    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:

    1. Start a Telegram session
    2. From the same machine, message the agent via openclaw-tui
    3. Agent receives the TUI message
    4. Reply is delivered to Telegram, not back to TUI

    Affects v2026.5.3-1 on macOS (Darwin 24.1.0, Node v24.12.0). Looks like the same origin.provider vs deliveryContext mismatch — deliveryContext should win.

  3. leroylim commented on May 6, 2026

    @leroylim

    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.

  4. cgbahk commented on May 6, 2026

    @cgbahk

    I was suffering same issue, (not sure) but adding this to openclaw.json seems to resolve this (Tested on 2026.5.5 / 2026.5.4 / 2026.4.27)

      "messages": {
        "groupChat": {
          "visibleReplies": "automatic"
        }
      }

    You guys may try too.

  5. fmatray commented on May 9, 2026

    @fmatray

    it doesn't work for me

    I was suffering same issue, (not sure) but adding this to openclaw.json seems to resolve this (Tested on 2026.5.5 / 2026.5.4 / 2026.4.27)

    "messages": {
    "groupChat": {
    "visibleReplies": "automatic"
    }
    }
    You guys may try too.

  6. pfrederiksen commented on May 30, 2026

    @pfrederiksen
    Contributor

    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.

  7. pfrederiksen commented on May 30, 2026

    @pfrederiksen
    Contributor

    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.

  8. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    on Jun 14, 2026
  9. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions