Skip to content

Forum topic replies land in General: message_thread_id dropped in session auto-reply delivery #78724

@Lead2Legacy

Description

@Lead2Legacy

Summary

Session auto-replies in Telegram forum groups consistently land in the General topic instead of the correct topic thread, even when:

  • The topic is properly configured in channels.telegram.groups.<id>.topics.<threadId>
  • The session's deliveryContext.threadId is correct
  • The session state shows lastThreadId matching the topic
  • Direct sends via the message tool with explicit threadId work correctly

Steps to Reproduce

  1. Configure a forum group with topics in openclaw.json
  2. Send a message in a specific topic (not General)
  3. The gateway correctly routes to the session with the right threadSpec
  4. The CLI processes and produces a reply
  5. The reply is delivered to the group's General topic instead of the originating topic

Expected Behavior

Reply should include message_thread_id matching the topic the user messaged in.

Actual Behavior

Reply lands in General (topic 1). The message_thread_id parameter is not included in the sendMessage API call during session reply delivery.

Evidence

  • Direct sends via MCP message tool with threadId parameter → lands in correct topic ✓
  • Session auto-reply from same session with deliveryContext.threadId set → lands in General ✗
  • Gateway log shows sendMessage ok chat=-100XXXXXXXXXX message=XXXX with no thread indicator
  • No "retrying without thread" fallback triggered (checked logs)
  • buildTelegramThreadParams and deliveryBaseOptions.thread appear correctly wired in source

Environment

  • OpenClaw 2026.5.6 (c97b9f7)
  • macOS (darwin)
  • Telegram forum groups with topics enabled
  • Affects both main and atlas2 agents
  • Multiple groups confirmed affected (Atlas Command, Amplify)

Workaround

Using the message tool with explicit threadId for topic-targeted sends works. Session auto-replies do not.

Notes

The 2026.5.6 changelog mentions "Telegram forum-topic targets" fix, but the issue persists for the session reply delivery path specifically. The fix may have addressed runtime binding creation (parentConversationId) but not the final reply send.

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