openclaw - ✅(Solved) Fix sessions_spawn: LLMs pass streamTo for subagent runtime causing 100% spawn failures [1 pull requests, 1 participants]

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…
GitHub stats
openclaw/openclaw#63120Fetched 2026-04-09 07:58:16
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

When using sessions_spawn with runtime="subagent", LLMs (e.g. GPT-5.4, Claude) consistently pass streamTo: "parent" alongside the spawn call. This triggers the validation error: In our production multi-agent setup (OpenClaw 2026.4.1), Secretary agent attempted to spawn CTO/dev-lead agents 10+ consecutive times, all failing with the same error. The agent retried with different parameter combinations but never dropped streamTo, because nothing in the schema told it to. // → { "status": "error", "error": "streamTo is only supported for runtime=acp; got runtime=subagent" }

Root Cause

The streamTo parameter in the SessionsSpawnToolSchema has no description field, unlike other runtime-specific parameters such as resumeSessionId (which explicitly states Requires runtime="acp") and lightContext (which states Only applies to runtime='subagent').

Without guidance in the schema, LLMs see streamTo: "parent" as a generally useful option and include it by default — especially since streaming results back to the parent sounds like desirable behavior for any spawn.

The tool description (describeSessionsSpawnTool) also doesn't mention which parameters are runtime-specific.

Fix Action

Fixed

PR fix notes

PR #63121: fix(tools): add acp-only guidance to sessions_spawn streamTo parameter

Description (problem / solution / changelog)

Summary

  • Add description to streamTo schema field in sessions_spawn tool, explicitly stating it requires runtime="acp" and must not be set for runtime="subagent"
  • Update describeSessionsSpawnTool() to list which params are subagent-safe vs acp-only
  • Add test verifying the schema description contains acp guidance

Closes #63120

Context

LLMs using sessions_spawn consistently pass streamTo: "parent" even when runtime is "subagent", because nothing in the schema tells them it's acp-only. This causes 100% spawn failures in multi-agent setups. Other acp-only params like resumeSessionId already have descriptions stating the requirement — streamTo was the only one missing this guidance.

Test plan

  • Existing sessions-spawn-tool.test.ts tests pass (13/13)
  • New test verifies streamTo schema description mentions both "acp" and "subagent"
  • Manual verification: the runtime validation at L195 remains unchanged (defense in depth)

🤖 Generated with Claude Code via Happy

Changed files

  • src/agents/tool-description-presets.ts (modified, +2/-1)
  • src/agents/tools/sessions-spawn-tool.test.ts (modified, +15/-0)
  • src/agents/tools/sessions-spawn-tool.ts (modified, +4/-1)

Code Example

streamTo is only supported for runtime=acp; got runtime=subagent

---

{
  "agentId": "cto",
  "runtime": "subagent",
  "streamTo": "parent",
  "task": "..."
}
// → { "status": "error", "error": "streamTo is only supported for runtime=acp; got runtime=subagent" }
RAW_BUFFERClick to expand / collapse

Problem

When using sessions_spawn with runtime="subagent", LLMs (e.g. GPT-5.4, Claude) consistently pass streamTo: "parent" alongside the spawn call. This triggers the validation error:

streamTo is only supported for runtime=acp; got runtime=subagent

This causes 100% failure rate for all subagent spawns when the LLM decides to include streamTo.

Root Cause

The streamTo parameter in the SessionsSpawnToolSchema has no description field, unlike other runtime-specific parameters such as resumeSessionId (which explicitly states Requires runtime="acp") and lightContext (which states Only applies to runtime='subagent').

Without guidance in the schema, LLMs see streamTo: "parent" as a generally useful option and include it by default — especially since streaming results back to the parent sounds like desirable behavior for any spawn.

The tool description (describeSessionsSpawnTool) also doesn't mention which parameters are runtime-specific.

Impact

In our production multi-agent setup (OpenClaw 2026.4.1), Secretary agent attempted to spawn CTO/dev-lead agents 10+ consecutive times, all failing with the same error. The agent retried with different parameter combinations but never dropped streamTo, because nothing in the schema told it to.

This effectively breaks the entire cross-agent collaboration chain — tasks get written to the task board but no agent is spawned to execute them.

Observed Behavior

{
  "agentId": "cto",
  "runtime": "subagent",
  "streamTo": "parent",
  "task": "..."
}
// → { "status": "error", "error": "streamTo is only supported for runtime=acp; got runtime=subagent" }

The LLM retried 10+ times, sometimes simplifying other parameters, but always kept streamTo: "parent".

Expected Behavior

The schema should clearly indicate that streamTo is acp-only, so LLMs don't include it for subagent spawns. Other acp-only parameters already follow this pattern (e.g., resumeSessionId).

Suggested Fix

  1. Add a description to the streamTo schema field stating it requires runtime="acp"
  2. Update the tool description to list which params are subagent-safe vs acp-only

Environment

  • OpenClaw 2026.4.1
  • Models affected: GPT-5.4 (nexus), likely all LLMs

extent analysis

TL;DR

Update the streamTo schema field description to indicate it requires runtime="acp" to prevent LLMs from including it in subagent spawns.

Guidance

  • Review the SessionsSpawnToolSchema and add a description field to the streamTo parameter specifying that it is only supported for runtime="acp".
  • Update the tool description (describeSessionsSpawnTool) to clearly list which parameters are runtime-specific, including streamTo as acp-only.
  • Verify that LLMs no longer include streamTo: "parent" in subagent spawn calls after the schema update.
  • Test the updated schema with multiple LLMs, including GPT-5.4, to ensure the fix is effective.

Example

No code snippet is provided as the issue is related to schema updates rather than code changes.

Notes

The suggested fix assumes that updating the schema will correctly inform LLMs to exclude streamTo for subagent spawns. However, additional testing may be necessary to ensure that all affected LLMs behave as expected after the update.

Recommendation

Apply the suggested fix by updating the streamTo schema field description and the tool description to clearly indicate runtime-specific parameters, as this directly addresses the root cause of the issue.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING