Skip to content

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

Open
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-63121-fix-sessions-spawn-streamto-description
Open

fix(tools): add acp-only guidance to sessions_spawn streamTo parameter#2157
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-63121-fix-sessions-spawn-streamto-description

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 28, 2026

Copy link
Copy Markdown
Owner

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 openclaw#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

SuperSupeng and others added 2 commits April 10, 2026 13:48
LLMs using sessions_spawn tend to pass streamTo: "parent" even when
runtime is "subagent", causing 100% spawn failures because the
validation rejects streamTo for non-acp runtimes. This happens because
the streamTo schema field has no description indicating it is acp-only,
so the model treats it as a generally useful option.

This change:
- Adds a description to the streamTo schema field stating it requires
  runtime="acp" and must not be set for runtime="subagent"
- Updates the tool description to explicitly list which params are
  subagent-safe and which require acp
- Adds a test verifying the schema description contains acp guidance

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>
Address review feedback: the previous wording "only pass task, agentId,
and runTimeoutSeconds" was overly restrictive and could cause LLMs to
skip valid subagent params like model, cwd, attachments, etc. Changed
to a prohibit-list approach: "do not set streamTo or resumeSessionId".

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sessions_spawn: LLMs pass streamTo for subagent runtime causing 100% spawn failures

2 participants