fix(tools): add acp-only guidance to sessions_spawn streamTo parameter#2157
Open
BingqingLyu wants to merge 2 commits into
Open
fix(tools): add acp-only guidance to sessions_spawn streamTo parameter#2157BingqingLyu wants to merge 2 commits into
BingqingLyu wants to merge 2 commits into
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
descriptiontostreamToschema field insessions_spawntool, explicitly stating it requiresruntime="acp"and must not be set forruntime="subagent"describeSessionsSpawnTool()to list which params are subagent-safe vs acp-onlyCloses openclaw#63120
Context
LLMs using
sessions_spawnconsistently passstreamTo: "parent"even whenruntimeis"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 likeresumeSessionIdalready have descriptions stating the requirement —streamTowas the only one missing this guidance.Test plan
sessions-spawn-tool.test.tstests pass (13/13)streamToschema description mentions both "acp" and "subagent"🤖 Generated with Claude Code
via Happy