fix: silently ignore streamTo for non-ACP runtime in sessions_spawn (closes #43556)#47115
fix: silently ignore streamTo for non-ACP runtime in sessions_spawn (closes #43556)#47115Br1an67 wants to merge 1 commit into
Conversation
Greptile SummaryThis PR changes Key observations:
Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/tools/sessions-spawn-tool.test.ts
Line: 240-243
Comment:
**Test doesn't verify `streamTo` is stripped from subagent call**
The test confirms that `spawnSubagentDirectMock` was called and the result has `status: "accepted"`, but it doesn't assert that `streamTo` was NOT forwarded to `spawnSubagentDirect`. While `spawnSubagentDirect` never accepted `streamTo` in its interface (so the real behavior is correct), adding a `toHaveBeenCalledWith` assertion would make the intent of the "silently ignored" behavior explicit and protect against future regressions where someone accidentally wires `streamTo` through the subagent path.
```suggestion
expect(result.details).toMatchObject({
status: "accepted",
});
expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalledWith(
expect.not.objectContaining({ streamTo: expect.anything() }),
expect.any(Object),
);
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: f457e0f |
| expect(result.details).toMatchObject({ | ||
| status: "error", | ||
| status: "accepted", | ||
| }); | ||
| const details = result.details as { error?: string }; | ||
| expect(details.error).toContain("streamTo is only supported for runtime=acp"); | ||
| expect(hoisted.spawnAcpDirectMock).not.toHaveBeenCalled(); | ||
| expect(hoisted.spawnSubagentDirectMock).not.toHaveBeenCalled(); | ||
| expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalled(); |
There was a problem hiding this comment.
Test doesn't verify streamTo is stripped from subagent call
The test confirms that spawnSubagentDirectMock was called and the result has status: "accepted", but it doesn't assert that streamTo was NOT forwarded to spawnSubagentDirect. While spawnSubagentDirect never accepted streamTo in its interface (so the real behavior is correct), adding a toHaveBeenCalledWith assertion would make the intent of the "silently ignored" behavior explicit and protect against future regressions where someone accidentally wires streamTo through the subagent path.
| expect(result.details).toMatchObject({ | |
| status: "error", | |
| status: "accepted", | |
| }); | |
| const details = result.details as { error?: string }; | |
| expect(details.error).toContain("streamTo is only supported for runtime=acp"); | |
| expect(hoisted.spawnAcpDirectMock).not.toHaveBeenCalled(); | |
| expect(hoisted.spawnSubagentDirectMock).not.toHaveBeenCalled(); | |
| expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalled(); | |
| expect(result.details).toMatchObject({ | |
| status: "accepted", | |
| }); | |
| expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalledWith( | |
| expect.not.objectContaining({ streamTo: expect.anything() }), | |
| expect.any(Object), | |
| ); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/tools/sessions-spawn-tool.test.ts
Line: 240-243
Comment:
**Test doesn't verify `streamTo` is stripped from subagent call**
The test confirms that `spawnSubagentDirectMock` was called and the result has `status: "accepted"`, but it doesn't assert that `streamTo` was NOT forwarded to `spawnSubagentDirect`. While `spawnSubagentDirect` never accepted `streamTo` in its interface (so the real behavior is correct), adding a `toHaveBeenCalledWith` assertion would make the intent of the "silently ignored" behavior explicit and protect against future regressions where someone accidentally wires `streamTo` through the subagent path.
```suggestion
expect(result.details).toMatchObject({
status: "accepted",
});
expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalledWith(
expect.not.objectContaining({ streamTo: expect.anything() }),
expect.any(Object),
);
```
How can I resolve this? If you propose a fix, please make it concise.|
why check windows error? |
…loses openclaw#43556) Schema-following models (e.g. gpt-5.4) include streamTo:"parent" in every sessions_spawn call because it is visible in the tool schema. For runtime=subagent this caused a 400 error. Now streamTo is silently ignored for non-ACP runtimes instead of rejecting the request. Co-authored-by: Copilot <[email protected]>
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
23 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
I need this patch |
Summary
streamToparameter in thesessions_spawntool schema is visible to all runtime modes. Schema-following models (e.g. gpt-5.4) automatically includestreamTo: "parent"in every call. Forruntime=subagent(the default), this triggers a 400 error: "streamTo is only supported for runtime=acp".streamTois passed with non-ACP runtime, it is now silently ignored. The parameter only takes effect forruntime=acp.Change Type
Scope
Linked Issue/PR
User-visible / Behavior Changes
sessions_spawnwithstreamToparameter and non-ACP runtime no longer returns an error. The parameter is silently ignored.Security Impact
Repro + Verification
Steps
Expected
Actual
Evidence
pnpm tsgoclean (only pre-existing ui type errors)oxlintcleanHuman Verification
Review Conversations
Compatibility / Migration
Failure Recovery
Risks and Mitigations
None — silently ignoring an inapplicable parameter is strictly more permissive.