Skip to content

fix: prefer sessionKey over label in sessions_send instead of rejecting both#268

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-41255-fix-sessions-send-dual-params
Open

fix: prefer sessionKey over label in sessions_send instead of rejecting both#268
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-41255-fix-sessions-send-dual-params

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes openclaw#41199 (sessions_send portion).

When an LLM calls sessions_send with both sessionKey and label parameters, the tool currently returns an error: "Provide either sessionKey or label (not both)." This breaks agent-to-agent communication because LLMs consistently fill both optional parameters — confirmed across GPT, Kimi, and DeepSeek models.

What changed

Instead of rejecting the call, prefer sessionKey when both are provided. The existing fallback logic at line 74 (if (!sessionKey && labelParam)) already handles the label-only path correctly, so when sessionKey is present, labelParam is naturally ignored.

This is the least invasive fix — strictly more permissive, no behavior change for single-param calls.

Note on Issue 2 (message tool poll params)

Issue openclaw#41199 also describes a similar problem with the message tool rejecting action: "send" when poll parameters are present. That fix involves a different trade-off (silently ignoring poll params vs auto-switching action) and is better addressed in a separate PR after discussion.

Test plan

  • sessions_send with only sessionKey → works as before
  • sessions_send with only label → works as before
  • sessions_send with both sessionKey and label → uses sessionKey, no error
  • Agent-to-agent communication works across multiple models

…ns_send

LLMs consistently provide both optional sessionKey and label params
when calling sessions_send, triggering an unnecessary "Provide either
sessionKey or label (not both)" error. This breaks agent-to-agent
communication across multiple models (GPT, Kimi, DeepSeek).

When both are provided, prefer sessionKey and ignore label — the
existing fallback logic already handles the label-only path correctly.

Fixes openclaw#41199 (sessions_send portion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent-to-Agent Communication Tools Have Parameter Conflicts

2 participants