fix(agents): ignore acp-only streamTo on subagent sessions_spawn#56906
fix(agents): ignore acp-only streamTo on subagent sessions_spawn#56906vincentkoc wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac732a8f3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Type.String({ | ||
| enum: [...ACP_SPAWN_STREAM_TARGETS], | ||
| description: | ||
| 'ACP-only output routing hint. Only used for runtime="acp" and currently ignored for subagent spawns.', |
There was a problem hiding this comment.
Align streamTo contract text with actual subagent behavior
This schema description now says streamTo is "currently ignored for subagent spawns," but createSessionsSpawnTool still returns an error when streamTo is set and runtime !== "acp" (if (streamTo && runtime !== "acp") ...). In practice, callers relying on the updated contract will see request failures instead of a no-op when they pass streamTo for subagents. Please either update execution to ignore the field for subagent runtime or revert the schema wording so the contract matches runtime behavior.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR rebases a prior fix (#55483) cleanly onto The only code change is replacing
Confidence Score: 4/5Safe to merge after resolving the schema description mismatch — either update the description to reflect the error behavior or remove lines 136-141 to truly ignore the field. One P1 finding: the newly added schema description says
|
| Filename | Overview |
|---|---|
| src/agents/tools/sessions-spawn-tool.ts | Schema description for streamTo says 'currently ignored for subagent spawns' but the execute handler still returns an error for that case — documentation and behavior are inconsistent. |
| CHANGELOG.md | Adds a changelog entry crediting both contributors; entry is accurate at a high level but inherits the same 'ignore' language that does not match the actual error-returning behavior. |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agents/tools/sessions-spawn-tool.ts
Line: 44-50
Comment:
**Schema description contradicts actual runtime behavior**
The description states `"currently ignored for subagent spawns"`, but the execute handler at lines 136–141 returns an explicit error response when `streamTo` is supplied for a non-ACP runtime:
```ts
if (streamTo && runtime !== "acp") {
return jsonResult({
status: "error",
error: `streamTo is only supported for runtime=acp; got runtime=${runtime}`,
});
}
```
A caller reading this schema description will expect that passing `streamTo` to a subagent spawn is silently accepted/ignored, but they will actually receive an error response at runtime.
If the intent (as the PR title and description suggest) was to **truly ignore** `streamTo` for subagent spawns, the guard block at lines 136–141 should have been removed so the field is silently dropped. If the intent was simply to document the existing "unsupported" constraint, the description should say `"not supported for subagent spawns"` (or similar) rather than `"ignored"`.
Suggested fix (documenting the actual behavior):
```suggestion
streamTo: Type.Optional(
Type.String({
enum: [...ACP_SPAWN_STREAM_TARGETS],
description:
'ACP-only output routing hint. Only used for runtime="acp"; passing it for subagent spawns returns an error.',
}),
),
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(agents): ignore acp-only streamTo on..." | Re-trigger Greptile
| streamTo: Type.Optional( | ||
| Type.String({ | ||
| enum: [...ACP_SPAWN_STREAM_TARGETS], | ||
| description: | ||
| 'ACP-only output routing hint. Only used for runtime="acp" and currently ignored for subagent spawns.', | ||
| }), | ||
| ), |
There was a problem hiding this comment.
Schema description contradicts actual runtime behavior
The description states "currently ignored for subagent spawns", but the execute handler at lines 136–141 returns an explicit error response when streamTo is supplied for a non-ACP runtime:
if (streamTo && runtime !== "acp") {
return jsonResult({
status: "error",
error: `streamTo is only supported for runtime=acp; got runtime=${runtime}`,
});
}A caller reading this schema description will expect that passing streamTo to a subagent spawn is silently accepted/ignored, but they will actually receive an error response at runtime.
If the intent (as the PR title and description suggest) was to truly ignore streamTo for subagent spawns, the guard block at lines 136–141 should have been removed so the field is silently dropped. If the intent was simply to document the existing "unsupported" constraint, the description should say "not supported for subagent spawns" (or similar) rather than "ignored".
Suggested fix (documenting the actual behavior):
| streamTo: Type.Optional( | |
| Type.String({ | |
| enum: [...ACP_SPAWN_STREAM_TARGETS], | |
| description: | |
| 'ACP-only output routing hint. Only used for runtime="acp" and currently ignored for subagent spawns.', | |
| }), | |
| ), | |
| streamTo: Type.Optional( | |
| Type.String({ | |
| enum: [...ACP_SPAWN_STREAM_TARGETS], | |
| description: | |
| 'ACP-only output routing hint. Only used for runtime="acp"; passing it for subagent spawns returns an error.', | |
| }), | |
| ), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/tools/sessions-spawn-tool.ts
Line: 44-50
Comment:
**Schema description contradicts actual runtime behavior**
The description states `"currently ignored for subagent spawns"`, but the execute handler at lines 136–141 returns an explicit error response when `streamTo` is supplied for a non-ACP runtime:
```ts
if (streamTo && runtime !== "acp") {
return jsonResult({
status: "error",
error: `streamTo is only supported for runtime=acp; got runtime=${runtime}`,
});
}
```
A caller reading this schema description will expect that passing `streamTo` to a subagent spawn is silently accepted/ignored, but they will actually receive an error response at runtime.
If the intent (as the PR title and description suggest) was to **truly ignore** `streamTo` for subagent spawns, the guard block at lines 136–141 should have been removed so the field is silently dropped. If the intent was simply to document the existing "unsupported" constraint, the description should say `"not supported for subagent spawns"` (or similar) rather than `"ignored"`.
Suggested fix (documenting the actual behavior):
```suggestion
streamTo: Type.Optional(
Type.String({
enum: [...ACP_SPAWN_STREAM_TARGETS],
description:
'ACP-only output routing hint. Only used for runtime="acp"; passing it for subagent spawns returns an error.',
}),
),
```
How can I resolve this? If you propose a fix, please make it concise.|
closing as superseded by current main. |
Supersedes #55483.
streamToschema/docs fix on a clean branch