Skip to content

[Bug]: WebSocket sessions.send Creates Wrong Session Context (Group vs Direct) #83624

@git-hub-cloud

Description

@git-hub-cloud

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Issue: WebSocket sessions.send Creates Wrong Session Context (Group vs Direct)
Summary: When calling sessions.send via WebSocket API, tools don't appear in web UI session key direct session. Instead, a new group session is created, causing incorrect session context.
Symptoms:

  • WS sessions.send triggers agent processing
  • session.tool event fires but tools don't appear in web UI direct session
  • New group session is created instead of using existing direct session
  • Tool responses route to wrong session context
    Expected: Tools should appear and execute within the same direct session context that exists in web UI, not create a new group session.
Image

Steps to reproduce

  1. Connect WebSocket client to openclaw server with ed25519 keys, protocol 4
  2. Call sessions.send with message content and session key format: agent:main::direct:@im.wechat
  3. Observe: session.tool event fires but tools appear in new group session, not existing direct session

Expected behavior

Tools should execute within the same direct session context that exists in web UI.

Actual behavior

2 sessions: direct & group

OpenClaw version

2026.5.12

Operating system

debian

Install method

empty

Model

empty

Provider / routing chain

empty

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    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