Skip to content

Commit 30d3d9a

Browse files
committed
test(agents): update streamTo test to match new silent-drop behavior
Updated test case to reflect new behavior for runtime 'subagent'. Changed expected status from 'error' to 'accepted' and adjusted mock call expectations.
1 parent 6bc1b08 commit 30d3d9a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/agents/tools/sessions-spawn-tool.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ describe("sessions_spawn tool", () => {
284284
expect(hoisted.spawnSubagentDirectMock).not.toHaveBeenCalled();
285285
});
286286

287-
it('rejects streamTo when runtime is not "acp"', async () => {
287+
it('silently drops streamTo when runtime is "subagent"', async () => {
288288
const tool = createSessionsSpawnTool({
289289
agentSessionKey: "agent:main:main",
290290
});
@@ -296,12 +296,14 @@ describe("sessions_spawn tool", () => {
296296
});
297297

298298
expect(result.details).toMatchObject({
299-
status: "error",
299+
status: "accepted",
300+
childSessionKey: "agent:main:subagent:1",
300301
});
301-
const details = result.details as { error?: string };
302-
expect(details.error).toContain("streamTo is only supported for runtime=acp");
302+
expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalledWith(
303+
expect.not.objectContaining({ streamTo: "parent" }),
304+
expect.any(Object),
305+
);
303306
expect(hoisted.spawnAcpDirectMock).not.toHaveBeenCalled();
304-
expect(hoisted.spawnSubagentDirectMock).not.toHaveBeenCalled();
305307
});
306308

307309
it("keeps attachment content schema unconstrained for llama.cpp grammar safety", () => {

0 commit comments

Comments
 (0)