Bug Description
The sessions_spawn tool schema (SessionsSpawnToolSchema) accepts streamTo as an optional parameter for ALL runtimes, including runtime="subagent" and runtime="acp" together.
However, the execute function rejects streamTo when runtime="subagent":
if (streamTo && runtime !== "acp") return jsonResult({
error: `streamTo is only supported for runtime=acp; got runtime=${runtime}`
});
Expected Behavior
The schema should either:
- Not include
streamTo in the runtime="subagent" case (conditional schema), OR
- Document clearly that
streamTo is ignored/rejected for subagent runtime
Actual Behavior
- Schema accepts
streamTo unconditionally (no runtime-aware conditional)
- Execute function rejects it for
runtime="subagent"
- Agents that follow the schema may include
streamTo in their runtime="subagent calls, resulting in predictable errors
Schema Location
File: dist/pi-embedded-BYdcxQ5A.js, line ~22950
const SessionsSpawnToolSchema = Type.Object({
task: Type.String(),
runtime: optionalStringEnum(SESSIONS_SPAWN_RUNTIMES),
streamTo: optionalStringEnum(SESSIONS_SPAWN_ACP_STREAM_TARGETS), // ← allowed for ALL runtimes
...
})
Suggested Fix
Use a conditional/dependent schema so streamTo is only allowed when runtime="acp":
- When
runtime === "acp" → streamTo is allowed
- When
runtime === "subagent" → streamTo should be stripped or rejected at schema level
Or alternatively: strip streamTo from params before the validation check when runtime !== "acp".
Bug Description
The
sessions_spawntool schema (SessionsSpawnToolSchema) acceptsstreamToas an optional parameter for ALL runtimes, includingruntime="subagent"andruntime="acp"together.However, the execute function rejects
streamTowhenruntime="subagent":Expected Behavior
The schema should either:
streamToin theruntime="subagent"case (conditional schema), ORstreamTois ignored/rejected for subagent runtimeActual Behavior
streamTounconditionally (no runtime-aware conditional)runtime="subagent"streamToin theirruntime="subagentcalls, resulting in predictable errorsSchema Location
File:
dist/pi-embedded-BYdcxQ5A.js, line ~22950Suggested Fix
Use a conditional/dependent schema so
streamTois only allowed whenruntime="acp":runtime === "acp"→streamTois allowedruntime === "subagent"→streamToshould be stripped or rejected at schema levelOr alternatively: strip
streamTofrom params before the validation check whenruntime !== "acp".