fix(sessions_spawn): silently strip ACP-only fields for runtime=subagent#68397
fix(sessions_spawn): silently strip ACP-only fields for runtime=subagent#68397skernelx wants to merge 1 commit into
Conversation
Greptile SummarySwitches Confidence Score: 5/5Safe to merge — no P0/P1 issues; only a minor schema description wording nit remains. The logic change is minimal and correctly scoped: the subagent call never forwarded these fields before this PR, so the only behavioral delta is that non-ACP callers no longer receive an error result. ACP semantics are fully preserved. Tests are updated to verify both the drop and the continued pass-through for ACP. No files require special attention.
|
b6941a7 to
b2e15de
Compare
Schema-following LLMs (notably gpt-5.4) auto-fill every advertised tool parameter, including streamTo and resumeSessionId, regardless of the runtime value they also set. Under runtime="subagent" the executor rejected those fields with a hard error, making subagent spawn effectively unusable for these models (see openclaw#43556, openclaw#56193, openclaw#63120, Since the subagent code path never reads either field, treat them as no-ops when runtime!=="acp" instead of failing. ACP semantics are unchanged: when runtime==="acp" the fields still flow through unmodified and the existing ACP spawn logic validates them. Tests updated to match the new silently-drop behavior.
b2e15de to
e5c2067
Compare
Summary
sessions_spawncurrently hard-errors whenruntime="subagent"receivesstreamToorresumeSessionId, even though the subagent code path never consumes either field. Schema-strict providers (most notablygpt-5.4via the OpenAI bridge) auto-fill every advertised tool parameter on every call regardless of the runtime value the model also picks, which makes subagent spawns fail 90%+ of the time for those models.This PR switches the two ACP-only fields from "reject with error" to "silently drop when
runtime!=='acp'". ACP semantics are unchanged — whenruntime==='acp'the fields flow through unmodified and the existing ACP spawn logic validates them.Why the silent-drop approach
streamTo/resumeSessionId, so dropping them has no observable effect on the subagent code path.Related issues
Addresses (non-exhaustive):
streamTo:"parent"forruntime="subagent"and causes hard failure #68275 — sessions_spawn auto-injectsstreamTo:"parent"forruntime="subagent"Test plan
rejects resumeSessionId without runtime=acpandrejects streamTo when runtime is not "acp"cases to assert the new silent-drop contract: the tool forwards tospawnSubagentDirectwithout the ACP-only keys and returns no error.runtime=acppath still passesstreamTo/resumeSessionIdthrough tospawnAcpDirect(existing tests at lines 177, 226 still cover this).runtime="subagent"call withstreamTo="parent"through the tool-call bridge to catch future regressions at the schema layer.