Skip to content

[Feature] Telegram Forum Topics Support for PicoClaw #1270

@dimonb

Description

@dimonb

Feature Request: Telegram Forum Topics Support for PicoClaw

🎯 The Goal / Use Case

The goal is to provide PicoClaw users with the same organizational power available in OpenClaw. Specifically, support for Telegram Forum Topics (Threads) is needed to isolate conversation contexts for different agents or tasks within a single forum-enabled group. This allows PicoClaw to act as a centralized "Control Hub" where each topic can be bound to a specific agent or session, preventing message history from bleeding across different workstreams.

💡 Proposed Solution

Implement message_thread_id handling within the PicoClaw Telegram adapter:

  1. Session Isolation: Include the thread_id in the session key generation (e.g., chatId:topicId) so that each topic maintains its own isolated context/history.
  2. Agent Routing: Allow per-topic agent overrides via configuration (similar to OpenClaw's topicAgentOverrides), enabling different topics to automatically route to different specialized agents.
  3. ACP Support: Enable ACP (Agentic Control Plane) sessions to spawn within and bind to specific topics, ensuring all follow-up execution remains within the correct thread.

🛠 Potential Implementation (Optional)

  • Update TelegramInboundContext to extract and normalize message_thread_id from incoming updates.
  • Modify the sessionKey resolver to be thread-aware.
  • Expand the configuration schema to support a topics map under group configs, allowing for topic-specific agentId, systemPrompt, and skills.
  • Ensure all outbound sendMessage calls correctly pass the message_thread_id to maintain thread integrity.

🚦 Impact & Roadmap Alignment

  • This is a Core Feature
  • This is a Nice-to-Have / Enhancement
  • This aligns with the current Roadmap

🔄 Alternatives Considered

The current alternative is creating multiple separate groups for different agents, which is difficult to manage and clutters the Telegram chat list.

💬 Additional Context

Special handling should be considered for the "General" topic (ID 1), as Telegram handles it uniquely. This feature is critical for users who manage complex workflows with multiple specialized agents (e.g., mail processing, system admin, personal assistance) through a single bot interface.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions