Skip to content

[Bug]: Telegram group/topic sessions forbid same-chat message tool sends, blocking attachments/media despite same-chat thread routing support #43146

Description

@Robcis

Bug type

Behavior bug (incorrect output/state without crash)

Summary

In Telegram group/forum-topic sessions, OpenClaw injects a rule that forbids same-chat message tool sends, causing the agent to refuse sending files/media back into the same group/topic.

Steps to reproduce

  • Configure Telegram in OpenClaw and add the bot to a Telegram group with forum topics enabled.
  • Start chatting with the agent inside a specific Telegram topic.
  • Ask the agent to generate or send a small file/image/PDF back into that same topic.
  • Observe that the agent refuses to use the message tool in the same group/topic and does not send the attachment.

Expected behavior

The agent should be able to reply normally with text, and when needed use message.send to send files/media back into the same Telegram group/topic.

Actual behavior

The agent replies that it is blocked by session/group policy from using the message tool to send back into the same Telegram group, so attachments/media cannot be sent there.

OpenClaw version

2026.3.8

Operating system

Ubuntu Linux (kernel 6.17.0-14-generic)

Install method

npm global

Model

openai/gpt-5.4

Provider / routing chain

openclaw -> openai

Config file / key location

~/.openclaw/openclaw.json

Additional provider/model setup details

Telegram is enabled and working for normal chat replies.
channels.telegram.mediaMaxMb is set to 100, so this does not appear to be a file-size-limit issue.
The issue occurs in Telegram group/forum-topic sessions where normal text replies are auto-routed correctly.

Logs, screenshots, and evidence

Installed bundle contains this injected instruction:

function buildGroupChatContext(params) {
...
lines.push("Your replies are automatically sent to this group chat. Do not use the message tool to send to this same group — just reply normally.");
return lines.join(" ");
}

Found in:

~/.local/lib/node_modules/openclaw/dist/plugin-sdk/reply-UQ7w3uFC.js
also duplicated in other built bundles under ~/.local/lib/node_modules/openclaw/dist/...
Related evidence from the same install:

/**
* Auto-inject Telegram forum topic thread ID when the message tool targets
* the same chat the session originated from.
*/
function resolveTelegramAutoThreadId(params) {
...
}

This suggests same-chat Telegram topic routing exists, but the injected prompt rule prevents the model from using it.

Impact and severity

Affected: Telegram group/forum-topic users
Severity: Medium-High (blocks legitimate attachment/media workflows)
Frequency: 100% repro in affected group/topic sessions
Consequence: Agents can chat normally in the topic but cannot send generated files/media back into the same conversation, forcing manual workarounds

Additional information

This looks like a product-level contradiction rather than a pure transport failure:

The runtime appears to support same-chat Telegram topic routing for message tool sends but the group-chat prompt guidance explicitly forbids using the message tool in that same group

Suggested fix:

Keep normal auto-routed replies for text but relax the injected instruction so the agent may use message.send for attachments/media/files in the same Telegram group/topic when needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions