Skip to content

Bug: streamTo in sessions_spawn breaks subagent runtime #43556

Description

@yangliu19941121-ui

Bug: streamTo parameter in sessions_spawn breaks subagent runtime

Environment

  • OpenClaw version: 2026.3.8 (also affects 3.7+)
  • OS: macOS (Apple Silicon)
  • Runtime: subagent (default)
  • Model: aiberm/openai/gpt-5.4

Description

The streamTo parameter was added to the sessions_spawn tool schema for ACP runtime support. However, this parameter is visible to all runtime modes in the tool schema. When using models like gpt-5.4 that strictly follow tool schemas, the model automatically includes streamTo: "parent" in every sessions_spawn call.

For runtime=subagent (the default), this triggers a 400 error:

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

This makes sessions_spawn completely unusable for subagent-mode agents using schema-following models.

Steps to Reproduce

  1. Configure an agent with runtime=subagent (or default) using gpt-5.4
  2. Have the agent call sessions_spawn with any task
  3. The model will include streamTo: "parent" because it's in the tool schema
  4. API returns 400 error

Expected Behavior

Either:

  • streamTo should not appear in the tool schema when runtime != acp
  • Or streamTo should be silently ignored (not error) for non-ACP runtimes

Workaround

Patched 10 dist files to silently ignore streamTo for non-ACP runtime:

// Before (error):
if (streamTo && runtime !== "acp") return jsonResult({ status: "error", error: `streamTo is only supported...` });
// After (noop):
if (streamTo && runtime !== "acp") { /* noop */ }

Impact

  • All agents using subagent runtime + schema-following models are affected
  • 90%+ of sessions_spawn calls fail (115/127 in our testing)
  • Agents fall back to doing work themselves instead of delegating

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions