Skip to content

Commit abca662

Browse files
committed
fix(tools): tolerate duplicate sessionKey/label in sessions_send
LLMs and UI layers (ClawX, Control UI) sometimes mirror the same value into both `sessionKey` and `label` when calling `sessions_send`. This triggers the mutual-exclusion guard even though the intent is unambiguous. Relax the check: only reject when both params are provided AND they differ. When they are equal, treat the call as sessionKey-only (the more specific routing path). Fixes #64699
1 parent 3631ec1 commit abca662

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/agents/tools/sessions-send-tool.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ export function createSessionsSendTool(opts?: {
103103
const sessionKeyParam = readStringParam(params, "sessionKey");
104104
const labelParam = normalizeOptionalString(readStringParam(params, "label"));
105105
const labelAgentIdParam = normalizeOptionalString(readStringParam(params, "agentId"));
106-
if (sessionKeyParam && labelParam) {
106+
// When sessionKey and label are both provided but equal, treat it as
107+
// sessionKey-only. LLMs / UI layers sometimes mirror the value into
108+
// both fields unintentionally (see #64699).
109+
if (sessionKeyParam && labelParam && sessionKeyParam !== labelParam) {
107110
return jsonResult({
108111
runId: crypto.randomUUID(),
109112
status: "error",

0 commit comments

Comments
 (0)