Skip to content

[Bug]: Telegram Forum Topic Delivery Silently Fails #77248

@jack-jackhui

Description

@jack-jackhui

Bug Report: Telegram Forum Topic Delivery Silently Fails

Bug Type

Behavior bug (incorrect output/state without crash)

Summary

Responses to Telegram forum topic threads are silently dropped. The LLM generates a response, the session marks as "done", but no sendMessage API call is ever attempted. Direct messages to the same bot work correctly.

Environment

  • OpenClaw Version: 2026.5.2
  • OS: Linux (Oracle Cloud ARM)
  • Node.js: v24.13.0
  • Telegram Channel: Enabled with forum group configured

Steps to Reproduce

  1. Configure a Telegram forum group (supergroup with topics enabled)
  2. Send a message to a topic thread in that group
  3. Wait for the assistant to generate a response
  4. Observe that no response is delivered to Telegram

Expected Behavior

The generated response should be delivered to the Telegram topic thread.

Actual Behavior

  • Session processes the message and generates a response (visible in transcript)
  • Session status changes to "done"
  • No sendMessage API call is logged (neither success nor failure)
  • Response is never delivered to Telegram
  • No error is logged

Evidence from Logs

DM delivery works (sendMessage logged):

telegram sendMessage ok chat=XXXXXXXXXX message=7142
telegram sendMessage ok chat=XXXXXXXXXX message=7143

Topic delivery fails silently (no sendMessage logged):

  • Session transcript shows assistant response was generated
  • Session status shows "done" with runtimeMs indicating successful completion
  • No corresponding sendMessage ok or sendMessage failed log entry
  • No error logged

Workaround

Using the message tool with explicit target and threadId parameters works:

message(action="send", channel="telegram", target="-100XXXXXXXXXX", threadId="XXXXX", message="...")

This confirms the Telegram API itself is not the issue.

Key Observations

  1. DMs work perfectly — same bot, same gateway, same time period
  2. Manual message tool works — topic delivery via explicit tool call succeeds
  3. Automatic delivery is skipped — the step between response generation and sendMessage is failing silently
  4. No errors logged — makes debugging difficult; the session just completes without delivery

Suspected Root Cause

The delivery routing for forum topic sessions appears to be silently failing or being skipped somewhere between:

  1. Response generation (works)
  2. Session completion marking (works)
  3. sendMessage API call (never reached)

The deliveryContext in the session metadata shows correct threadId, so the routing info is present but not being used.

Additional Context

  • Forum topics use message_thread_id parameter in Telegram API
  • The same group's General topic and regular messages may behave differently
  • Issue persists across gateway restarts
  • Multiple topics affected (not specific to one topic ID)

Session Metadata Example

{
  "status": "done",
  "deliveryContext": {
    "channel": "telegram",
    "to": "telegram:-100XXXXXXXXXX",
    "accountId": "default",
    "threadId": XXXXX
  },
  "runtimeMs": 25442
}

The threadId is correctly populated, but delivery never occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions