Skip to content

[Bug]: sessions_send unexpectedly injects label, causing mutual-exclusion error with sessionKey #64699

@sunxq1017-hash

Description

@sunxq1017-hash

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When calling sessions_send, the effective invocation appears to include label even when the caller intends to send only by sessionKey.

调用 sessions_send 时,实际执行链路中疑似会被自动补入 label,即使调用方本意只传 sessionKey。这会导致本来合法的调用触发互斥报错。

This was observed from both:

ClawX session path
OpenClaw Control UI path
该问题同时在以下两条路径观察到:

ClawX 会话路径
OpenClaw Control UI 路径
This suggests the bug is not specific to ClawX, but likely exists in a shared invocation / argument assembly layer.

这说明问题并非 ClawX 私有,更可能存在于共享的调用封装或参数组装层。

Steps to reproduce

  1. Open OpenClaw Control UI.
  2. Call sessions_send targeting agent:tywin:main.
  3. Intend to send by sessionKey with message test.
  4. Observe the emitted invocation includes both sessionKey and label.
  5. Observe the tool returns:
    Provide either sessionKey or label (not both).

Expected behavior

A sessions_send call intended to route by sessionKey should execute without silently adding label.

Actual behavior

Observed emitted call:

{
"sessionKey": "agent:tywin:main",
"label": "agent:tywin:main",
"agentId": "main",
"message": "test",
"timeoutSeconds": 30
}

Observed tool error:

Provide either sessionKey or label (not both).

OpenClaw version

2026.4.9

Operating system

macOS 15.5

Install method

mac app (ClawX embedded OpenClaw runtime)

Model

openrouter/openai/gpt-5.4

Provider / routing chain

Multiple client paths reproduced the same behavior: - ClawX -> embedded OpenClaw runtime -> sessions_send tool - OpenClaw Control UI -> embedded OpenClaw runtime -> sessions_send tool

Additional provider/model setup details

The same behavior was observed through both ClawX and OpenClaw Control UI, so this does not appear to be a ClawX-only client bug.

Logs, screenshots, and evidence

Observed tool error:
`Provide either sessionKey or label (not both).`

Follow-up testing also showed a separate policy-layer error when trying a label-only path:
`Agent-to-agent messaging denied by tools.agentToAgent.allow.`

However, the primary bug reported here is the apparent unexpected `label` injection causing the mutual-exclusion failure.

Impact and severity

Affected: users trying to send cross-session messages with sessions_send
Severity: Medium
Frequency: Observed in direct testing
Consequence: sessions_send fails before delivery because the emitted arguments violate the tool's mutual-exclusion rule

Additional information

This was observed on OpenClaw 2026.4.9 in a ClawX embedded runtime.

The issue report is focused on the apparent argument mutation/injection behavior:
a call intended to route by sessionKey appears to fail as if both sessionKey and label were present in the final invocation.

A separate policy denial was also observed later, but that is likely a different issue. This report is only for the mutual-exclusion failure path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.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