openclaw - 💡(How to fix) Fix [Bug]: send_to_task rejects model-generated `SendMessage` body instead of normalizing to `message` (A2A broken for Anthropic/Pi agents; sibling of #84079)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The send_to_task agent-to-agent tool (runtime SessionsSendToolSchema / src/agents/tools/sessions-send-tool.ts) requires a body property literally named message, but Anthropic/Pi-backed agents emit the body as SendMessage (the same non-canonical alias documented in #84079). Because the alias normalization added in #84079 was wired only into the channel message tool (message-action-runnerbuildSendPayloadParts) and not into send_to_task, every cross-agent send a model attempts with the SendMessage body fails schema validation before execute runs:

Validation failed for tool "send_to_task":
  - message: must have required properties message

Net effect: agent-to-agent (A2A) messaging is effectively broken for Anthropic/Pi agents. The delivery layer is fine — sending via the CLI (legacy_platform agent --session-key … --message …) or any path that supplies a literal message works. The break is purely the tool-facing schema/alias mismatch. This is a direct sibling of the now-closed #84079, which fixed the same class of bug for the message tool only.

Root Cause

The send_to_task agent-to-agent tool (runtime SessionsSendToolSchema / src/agents/tools/sessions-send-tool.ts) requires a body property literally named message, but Anthropic/Pi-backed agents emit the body as SendMessage (the same non-canonical alias documented in #84079). Because the alias normalization added in #84079 was wired only into the channel message tool (message-action-runnerbuildSendPayloadParts) and not into send_to_task, every cross-agent send a model attempts with the SendMessage body fails schema validation before execute runs:

Fix Action

Fix / Workaround

I verified this fix locally against 2026.5.27 (patched the installed legacy_platform-tools bundle, restarted the gateway): bidirectional send_to_task between two Anthropic agents then worked end to end. Happy to open a PR against src/agents/tools/sessions-send-tool.ts.

Code Example

Validation failed for tool "send_to_task":
  - message: must have required properties message

---

{
  "name": "sessions_send",
  "arguments": {
    "sessionKey": "agent:other:main",
    "SendMessage": "…body text…",
    "timeoutSeconds": 60
  }
}

---

if (typeof params.message !== "string" || !params.message.trim()) {
  for (const alias of ["SendMessage", "content", "text"]) {
    const v = params[alias];
    if (typeof v === "string" && v.trim()) { params.message = v; break; }
  }
}
RAW_BUFFERClick to expand / collapse

Bug type

Bug (consistent failure)

Summary

The send_to_task agent-to-agent tool (runtime SessionsSendToolSchema / src/agents/tools/sessions-send-tool.ts) requires a body property literally named message, but Anthropic/Pi-backed agents emit the body as SendMessage (the same non-canonical alias documented in #84079). Because the alias normalization added in #84079 was wired only into the channel message tool (message-action-runnerbuildSendPayloadParts) and not into send_to_task, every cross-agent send a model attempts with the SendMessage body fails schema validation before execute runs:

Validation failed for tool "send_to_task":
  - message: must have required properties message

Net effect: agent-to-agent (A2A) messaging is effectively broken for Anthropic/Pi agents. The delivery layer is fine — sending via the CLI (legacy_platform agent --session-key … --message …) or any path that supplies a literal message works. The break is purely the tool-facing schema/alias mismatch. This is a direct sibling of the now-closed #84079, which fixed the same class of bug for the message tool only.

Steps to reproduce

  1. Run OCPlatform with multiple isolated agents and tools.agentToAgent.enabled = true.
  2. Use an Anthropic/Pi-backed agent (e.g. anthropic-api/claude-opus-4-8).
  3. Have the agent call send_to_task to reach another agent/session, emitting the body as SendMessage (which these models reliably do).
  4. Observe the call is rejected with must have required properties message. The same agent cannot reply either — every outbound send_to_task fails identically.

Observed rejected tool call shape:

{
  "name": "sessions_send",
  "arguments": {
    "sessionKey": "agent:other:main",
    "SendMessage": "…body text…",
    "timeoutSeconds": 60
  }
}

Expected behavior

send_to_task should normalize the non-canonical body aliases (SendMessage, content, text) to message before validation, exactly as the message tool does after #84079, so model-emitted A2A sends are delivered instead of rejected.

Suggested fix

Mirror the #84079 normalization in the sessions-send tool:

  1. In SessionsSendToolSchema, make message optional and add optional SendMessage / content / text alias properties (so the call passes schema validation).
  2. At the start of createSessionsSendTool().execute, before the required-message read, coalesce the first non-empty alias into params.message:
if (typeof params.message !== "string" || !params.message.trim()) {
  for (const alias of ["SendMessage", "content", "text"]) {
    const v = params[alias];
    if (typeof v === "string" && v.trim()) { params.message = v; break; }
  }
}

I verified this fix locally against 2026.5.27 (patched the installed legacy_platform-tools bundle, restarted the gateway): bidirectional send_to_task between two Anthropic agents then worked end to end. Happy to open a PR against src/agents/tools/sessions-send-tool.ts.

Version

OCPlatform 2026.5.27 (commit 27ae826), macOS (arm64), Node v25.x. Embedded/Pi runtime, Anthropic provider.

Related

  • #84079 — same alias-normalization bug fixed for the message tool (closed). This issue is the un-fixed send_to_task counterpart.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

send_to_task should normalize the non-canonical body aliases (SendMessage, content, text) to message before validation, exactly as the message tool does after #84079, so model-emitted A2A sends are delivered instead of rejected.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: send_to_task rejects model-generated `SendMessage` body instead of normalizing to `message` (A2A broken for Anthropic/Pi agents; sibling of #84079)