Summary
When running in Telegram forum topics (supergroup with is_forum: true), the embedded agent's message tool is automatically disabled via the internal disableMessageTool flag. This prevents the agent from sending file attachments (documents, images) as responses in topic conversations.
Environment
- OpenClaw version: 2026.2.26
- Channel: Telegram (Bot API, long polling)
- Forum group with 9 topics configured
- Model: gpt-5.3-codex
Steps to Reproduce
- Configure a Telegram forum supergroup with topics in
openclaw.json
- Set
channels.telegram.actions.sendMessage: true
- Set
tools.allow: ["*"] (explicitly allow all tools)
- Start gateway, send a message in any topic asking the bot to send a file attachment
- Bot responds: "message tool disabled in this chat" (or equivalent in configured language)
Expected Behavior
The agent should have access to the message tool in forum topics, at least when:
channels.telegram.actions.sendMessage: true is explicitly set
tools.allow: ["*"] is explicitly set
- The topic has
groupPolicy: "open"
Actual Behavior
The message tool is unconditionally disabled in forum topic contexts. The agent correctly identifies this restriction and tells the user it cannot send file attachments.
Root Cause Analysis
From source code inspection:
src/agents/pi-tools.ts:235-236: disableMessageTool parameter controls agent-level access
src/agents/openclaw-tools.ts:95-97: tool gating check uses this parameter
- In forum topic contexts,
disableMessageTool is automatically set to true
- This internal flag is NOT overridable via config (
tools.allow, actions.sendMessage, etc.)
Workaround
Using exec tool to call the CLI directly:
openclaw message send --channel telegram --target <chat_id> --thread-id <topic_id> --media /path/to/file
This works but requires the agent to be instructed via system prompt.
Proposed Fix
Allow disableMessageTool to be overridden by user config, e.g.:
- When
channels.telegram.actions.sendMessage: true is set, respect it in topic contexts
- Or add a
tools.message.forceEnable: true config option
- Or make
disableMessageTool respect tools.allow / tools.deny config
Related
Summary
When running in Telegram forum topics (supergroup with
is_forum: true), the embedded agent'smessagetool is automatically disabled via the internaldisableMessageToolflag. This prevents the agent from sending file attachments (documents, images) as responses in topic conversations.Environment
Steps to Reproduce
openclaw.jsonchannels.telegram.actions.sendMessage: truetools.allow: ["*"](explicitly allow all tools)Expected Behavior
The agent should have access to the
messagetool in forum topics, at least when:channels.telegram.actions.sendMessage: trueis explicitly settools.allow: ["*"]is explicitly setgroupPolicy: "open"Actual Behavior
The
messagetool is unconditionally disabled in forum topic contexts. The agent correctly identifies this restriction and tells the user it cannot send file attachments.Root Cause Analysis
From source code inspection:
src/agents/pi-tools.ts:235-236:disableMessageToolparameter controls agent-level accesssrc/agents/openclaw-tools.ts:95-97: tool gating check uses this parameterdisableMessageToolis automatically set totruetools.allow,actions.sendMessage, etc.)Workaround
Using
exectool to call the CLI directly:This works but requires the agent to be instructed via system prompt.
Proposed Fix
Allow
disableMessageToolto be overridden by user config, e.g.:channels.telegram.actions.sendMessage: trueis set, respect it in topic contextstools.message.forceEnable: trueconfig optiondisableMessageToolrespecttools.allow/tools.denyconfigRelated