openclaw - 💡(How to fix) Fix Telegram forum topic responses routed to DM instead of group (channel=webchat instead of channel=telegram)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a bot responds to messages in a Telegram forum topic group, the response gets routed to the user's DM instead of back to the group topic. The response is incorrectly tagged as channel=webchat instead of channel=telegram, causing ANNOUNCE_SKIP or delivery to the wrong destination.

Root Cause

When a bot responds to messages in a Telegram forum topic group, the response gets routed to the user's DM instead of back to the group topic. The response is incorrectly tagged as channel=webchat instead of channel=telegram, causing ANNOUNCE_SKIP or delivery to the wrong destination.

Fix Action

Workaround

Posting directly via Telegram Bot API works fine — sendMessage with message_thread_id delivers correctly. The bug is specifically in OpenClaw's routing/delivery layer for forum topic responses.

Code Example

[agent:nested] session=agent:main:telegram:group:-1003926662776 run=4af58a63... channel=webchat ANNOUNCE_SKIP
[agent:nested] session=agent:main:telegram:group:-1003926662776:topic:2947 run=... channel=webchat <response text>

---

{
  channels: {
    telegram: {
      groupPolicy: "open",
      groupAllowFrom: ["*"],
      groups: {
        "-1003926662776": {
          requireMention: false,
          allowFrom: ["*"]
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Bug: Telegram Forum Topic Response Routing

Summary

When a bot responds to messages in a Telegram forum topic group, the response gets routed to the user's DM instead of back to the group topic. The response is incorrectly tagged as channel=webchat instead of channel=telegram, causing ANNOUNCE_SKIP or delivery to the wrong destination.

Environment

  • OpenClaw version: 2026.5.22
  • Telegram group: forum/supergroup with topics enabled
  • Two bots confirmed affected: both running on separate gateways (Mac Mini + Worker node)

Expected Behavior

When a bot receives a message in a Telegram forum topic (e.g., telegram:group:-1003926662776:topic:2947), its response should be delivered back to the same group topic via the Telegram Bot API sendMessage with the appropriate message_thread_id.

Actual Behavior

  1. Bot receives group messages correctly ✅
  2. Bot generates responses correctly ✅
  3. Response gets tagged channel=webchat instead of channel=telegram
  4. Response is delivered to the user's DM (chatId = user's personal ID) instead of the group ❌
  5. Some responses get ANNOUNCE_SKIP

Evidence from Logs

[agent:nested] session=agent:main:telegram:group:-1003926662776 run=4af58a63... channel=webchat ANNOUNCE_SKIP
[agent:nested] session=agent:main:telegram:group:-1003926662776:topic:2947 run=... channel=webchat <response text>

The group session \deliveryContext`` shows:

  • accountId: "default" instead of the Telegram account
  • origin.provider: "webchat" instead of "telegram" for the topic session

Session Keys Affected

  • agent:main:telegram:group:-1003926662776 (main group session)
  • agent:main:telegram:group:-1003926662776:topic:2947 (topic-specific session)

Configuration (confirmed valid via openclaw config validate)

{
  channels: {
    telegram: {
      groupPolicy: "open",
      groupAllowFrom: ["*"],
      groups: {
        "-1003926662776": {
          requireMention: false,
          allowFrom: ["*"]
        }
      }
    }
  }
}

Workaround

Posting directly via Telegram Bot API works fine — sendMessage with message_thread_id delivers correctly. The bug is specifically in OpenClaw's routing/delivery layer for forum topic responses.

Reproducibility

100% reproducible on two separate gateway instances with two different bots. Regular (non-forum) groups may also be affected but forum topics are the confirmed case.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Telegram forum topic responses routed to DM instead of group (channel=webchat instead of channel=telegram)