fix: prefer sessionKey over label in sessions_send instead of rejecting both#41255
fix: prefer sessionKey over label in sessions_send instead of rejecting both#41255he-yufeng 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)
Greptile SummaryThis PR removes the strict mutual-exclusivity check between Key observations:
Confidence Score: 5/5
Last reviewed commit: 5e5f3b8 |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex automated review: keeping this open. Keep open. Current main at a253660 still rejects Best possible solution: Keep this PR open as a valid implementation candidate until maintainers choose and merge one canonical What I checked:
Remaining risk / open question:
Codex Review notes: model gpt-5.5, reasoning high; reviewed against a25366038503. |
|
Thanks @he-yufeng. I’m closing this as superseded by #39551 because both PRs target the same Clownfish is keeping the canonical review path on #39551 so validation, follow-up, and contributor credit stay in one place. Credit for this narrow fix remains in this source PR. If this branch covers a distinct behavior that still reproduces after #39551 lands, please reply and we can reopen or split it back out. |
Summary
Fixes #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 #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