Skip to content

[Bug]: sessions_spawn(runtime="subagent") can receive ACP-only streamTo from the current tool-call bridge #56193

@RevisitMoon

Description

@RevisitMoon

Bug Description

sessions_spawn correctly defines streamTo as an ACP-only field, and the executor explicitly rejects it when runtime !== "acp".

However, in the current tool-call path I observed sessions_spawn(runtime="subagent") receiving streamTo anyway, even though the intended call was a minimal subagent spawn.

That leads to an error like:

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

This looks like a parameter pollution / tool-call bridge issue rather than a sessions_spawn business-logic issue.

Expected Behavior

When a caller intends a plain subagent spawn, the actual executed params should not contain ACP-only fields such as streamTo.

In other words:

  • runtime="subagent" calls should arrive without ACP-only routing fields
  • streamTo should only appear for genuine ACP spawn flows

Actual Behavior

A minimal sessions_spawn attempt for runtime="subagent" failed before entering normal spawn flow because streamTo was present in the executed args.

The executor then correctly rejected it with:

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

What I checked

streamTo is intentionally ACP-only

Relevant code:

  • src/agents/acp-spawn.ts
  • src/agents/tools/sessions-spawn-tool.ts

streamTo was introduced for ACP parent-streaming behavior and has valid ACP semantics.

sessions_spawn core logic appears correct

sessions-spawn-tool.ts explicitly does:

  • parse streamTo
  • reject it when runtime !== "acp"

That part looks intentional and correct.

I did not find evidence that core sessions_spawn logic itself injects streamTo

Searching the core source only found streamTo in:

  • ACP spawn logic
  • sessions_spawn schema/tool implementation
  • related tests

I did not find a separate OpenClaw core business layer that obviously injects streamTo into subagent calls.

Likely problem area

This makes the problem look more like:

  • tool-call bridge / adapter layer
  • parameter serialization / propagation layer
  • or some higher-level invocation path that carries optional schema fields into actual tool execution

Environment

  • OpenClaw version: local source checkout based on 2026.3.24
  • Runtime: local Linux / WSL2
  • Channel/surface: tool invocation path from active agent session
  • Observed during manual runtime validation

Suggested investigation direction

Please check the current tool-call bridge / adapter path for sessions_spawn and confirm whether optional schema fields are being propagated into actual executed params even when not intentionally requested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions