Skip to content

WebChat cannot attach to agent main session when Telegram holds deliveryContext #15189

@myeongjoon8848

Description

@myeongjoon8848

Bug Description

WebChat is supposed to attach to the agent's main session (agent:main:main) and share cross-channel context (as documented in Channel Routing):

WebChat behavior: WebChat attaches to the selected agent and defaults to the agent's main session. Because of this, WebChat lets you see cross-channel context for that agent in one place.

However, when Telegram is actively using the main session, WebChat creates a separate subagent session instead of attaching to agent:main:main. This breaks the cross-channel context sharing that previously worked.

Steps to Reproduce

  1. Have an active conversation on Telegram (DM with agent, session key agent:main:main)
  2. Open the WebChat Control UI
  3. Send a message via WebChat

Expected: WebChat attaches to agent:main:main and shares context with the Telegram conversation
Actual: WebChat creates a new subagent session (e.g., agent:main:subagent:6ba2c9a9-...), completely isolated from the Telegram session

Evidence

sessions.json shows agent:main:main with deliveryContext locked to Telegram:

{
  "sessionId": "5d8095cf-...",
  "lastChannel": "telegram",
  "deliveryContext": {
    "channel": "telegram",
    "to": "telegram:2057742728",
    "accountId": "default"
  },
  "lastTo": "telegram:2057742728",
  "lastAccountId": "default"
}

WebChat messages go to a separate subagent session instead of the main session.

Likely Cause

Related changelog entries suggest deliveryContext routing was tightened:

  • Gateway: avoid reusing last-to/accountId when the requested channel differs; sync deliveryContext with last route fields.
  • Sessions: propagate deliveryContext into last-route updates to keep account/channel routing stable.

This change likely prevents WebChat from attaching to a session whose deliveryContext.channel is telegram, even though the docs state WebChat should always attach to the main session.

Environment

  • OpenClaw version: 2026.2.12 (also reproduced on 2026.2.9)
  • OS: macOS 26.2 (arm64)
  • Channels: Telegram + WebChat
  • Gateway: local loopback, single agent (main)
  • Install method: npm global

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