Skip to content

sessions_send corrupts target session channel from 'telegram' to 'webchat' #31671

Description

@RicAgent

Bug Description

sessions_send from one agent to another changes the target session's channel field in sessions.json from "telegram" to "webchat". This breaks Telegram message routing — the target agent stops receiving Telegram messages from the user.

Steps to Reproduce

  1. Agent A (main) has a running session on Telegram
  2. Agent B (builder) has a running session on Telegram (channel: "telegram" in sessions.json)
  3. Agent A calls sessions_send(sessionKey="agent:builder:main", message="...")
  4. Builder processes the message and responds
  5. After this, builder's session in ~/.clawdbot/agents/builder/sessions/sessions.json shows "channel": "webchat" instead of "telegram"
  6. User sends a message to the builder Telegram bot → no response (message not routed to the session)

Expected Behavior

sessions_send should not modify the target session's channel field. The delivery context should remain unchanged — the session should continue to be associated with its original channel (Telegram).

Actual Behavior

The channel field is overwritten to "webchat" because sessions_send injects the message via the gateway (webchat transport), and this overwrites the session's channel association.

Workaround

Manually edit sessions.json to restore "channel": "telegram" and restart the gateway. This is fragile and not suitable for automation.

Impact

This prevents using sessions_send for agent-to-agent communication when the target agent uses Telegram. It breaks a key use case: a watchdog/supervisor agent relaunching a worker agent.

Environment

  • Clawdbot version: 2026.1.24-3
  • OS: Linux (Ubuntu)
  • Channel: Telegram
  • Config: agentToAgent enabled, multiple agents with separate Telegram bot accounts

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions