Skip to content

Bug: sessions_spawn exposes ACP-only fields and breaks runtime=subagent with schema-following models #56326

Description

@shenkq97

Summary

sessions_spawn currently exposes ACP-only fields such as streamTo and resumeSessionId in the public tool schema, even when the intended runtime is subagent.

With schema-following models, this can cause subagent spawns to fail with errors like:

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

This makes sessions_spawn(runtime="subagent") fragile or unusable in real multi-agent workflows.

Environment

  • OpenClaw version: 2026.3.24
  • OS: macOS (Apple Silicon)
  • Runtime: subagent
  • Model behavior: schema-following tool calls

What we confirmed locally

Tool schema

The public SessionsSpawnToolSchema includes both subagent and ACP fields together, including:

  • subagent-side fields:
    • task
    • label
    • runtime
    • agentId
    • attachments
    • attachAs
  • ACP-only fields:
    • resumeSessionId
    • cwd
    • streamTo

Execution path

In the sessions_spawn tool implementation, streamTo and resumeSessionId are validated before runtime dispatch:

  • if streamTo && runtime !== "acp" → error
  • if resumeSessionId && runtime !== "acp" → error

So if a model includes ACP-only fields in a runtime="subagent" call, execution fails before reaching spawnSubagentDirect(...).

Subagent runtime itself is not the problem

We verified that spawnSubagentDirect(...) itself does not require streamTo.

After locally patching the guard to ignore ACP-only fields for non-ACP runtime, subagent spawning worked again and we were able to run:

  • main -> researcher
  • researcher -> result push-back
  • a full multi-agent drill:
    • researcher
    • writer
    • coder

Expected behavior

One of the following should happen:

  1. streamTo and resumeSessionId should not be exposed in the tool schema for runtime="subagent", or
  2. ACP-only fields should be silently ignored/stripped when runtime="subagent".

Why this matters

This is especially easy to trigger with schema-following models, because once ACP-only fields are visible in the same tool schema, they may be carried into subagent calls even when the intent is correct.

This blocks real multi-agent delegation workflows.

Suggested fix

Short-term:

  • auto-strip or ignore ACP-only fields (streamTo, resumeSessionId) when runtime="subagent"

Long-term:

  • split ACP and subagent spawn schemas more clearly, or expose separate tools/helpers for each path

Local workaround used

We locally patched the built file to stop rejecting ACP-only fields for non-ACP runtime, then restarted the gateway. After that, subagent spawning succeeded.

This suggests the failure is in schema/tool-call robustness, not in the subagent runtime itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clawsweeperTracked by ClawSweeper automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions