fix: prefer sessionKey over label in sessions_send instead of rejecting both#268
Open
BingqingLyu wants to merge 1 commit into
Open
fix: prefer sessionKey over label in sessions_send instead of rejecting both#268BingqingLyu wants to merge 1 commit into
BingqingLyu wants to merge 1 commit into
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes openclaw#41199 (sessions_send portion).
When an LLM calls
sessions_sendwith bothsessionKeyandlabelparameters, 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
sessionKeywhen both are provided. The existing fallback logic at line 74 (if (!sessionKey && labelParam)) already handles the label-only path correctly, so whensessionKeyis present,labelParamis 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
messagetool rejectingaction: "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_sendwith onlysessionKey→ works as beforesessions_sendwith onlylabel→ works as beforesessions_sendwith bothsessionKeyandlabel→ usessessionKey, no error