Skip to content

Message tool (file attachments) auto-disabled in Telegram forum topics #31368

@kilhyeonjun

Description

@kilhyeonjun

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

  1. Configure a Telegram forum supergroup with topics in openclaw.json
  2. Set channels.telegram.actions.sendMessage: true
  3. Set tools.allow: ["*"] (explicitly allow all tools)
  4. Start gateway, send a message in any topic asking the bot to send a file attachment
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    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