Skip to content

Commit 7d3416f

Browse files
committed
wip
1 parent 731ab6b commit 7d3416f

File tree

2 files changed

+2
-60
lines changed

2 files changed

+2
-60
lines changed

typescript-sdk/packages/client/src/agent/__tests__/subscriber.test.ts

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -817,64 +817,6 @@ describe("RunAgentSubscriber", () => {
817817
}),
818818
);
819819
});
820-
821-
test("should handle multiple tool calls with different buffers", async () => {
822-
const multiToolAgent = new TestAgent();
823-
multiToolAgent.subscribe(mockSubscriber);
824-
multiToolAgent.setEventsToEmit([
825-
{
826-
type: EventType.TOOL_CALL_START,
827-
toolCallId: "call-1",
828-
toolCallName: "search",
829-
} as ToolCallStartEvent,
830-
{
831-
type: EventType.TOOL_CALL_START,
832-
toolCallId: "call-2",
833-
toolCallName: "calculate",
834-
} as ToolCallStartEvent,
835-
{
836-
type: EventType.TOOL_CALL_ARGS,
837-
toolCallId: "call-1",
838-
delta: '{"query": "test"}',
839-
} as ToolCallArgsEvent,
840-
{
841-
type: EventType.TOOL_CALL_ARGS,
842-
toolCallId: "call-2",
843-
delta: '{"a": 1, "b": 2}',
844-
} as ToolCallArgsEvent,
845-
{
846-
type: EventType.TOOL_CALL_END,
847-
toolCallId: "call-1",
848-
} as ToolCallEndEvent,
849-
{
850-
type: EventType.TOOL_CALL_END,
851-
toolCallId: "call-2",
852-
} as ToolCallEndEvent,
853-
]);
854-
855-
await multiToolAgent.runAgent({});
856-
857-
expect(mockSubscriber.onToolCallStartEvent).toHaveBeenCalledTimes(2);
858-
expect(mockSubscriber.onToolCallEndEvent).toHaveBeenCalledTimes(2);
859-
expect(mockSubscriber.onNewToolCall).toHaveBeenCalledTimes(2);
860-
861-
// Verify separate buffers were maintained
862-
expect(mockSubscriber.onToolCallEndEvent).toHaveBeenNthCalledWith(
863-
1,
864-
expect.objectContaining({
865-
toolCallName: "search",
866-
toolCallArgs: { query: "test" },
867-
}),
868-
);
869-
870-
expect(mockSubscriber.onToolCallEndEvent).toHaveBeenNthCalledWith(
871-
2,
872-
expect.objectContaining({
873-
toolCallName: "calculate",
874-
toolCallArgs: { a: 1, b: 2 },
875-
}),
876-
);
877-
});
878820
});
879821

880822
describe("Buffer Accumulation Tests", () => {

typescript-sdk/packages/client/src/agent/agent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ export abstract class AbstractAgent {
226226
throw error;
227227
}
228228

229-
return null as unknown as never;
229+
// Return an empty mutation instead of null to prevent EmptyError
230+
return {} as AgentStateMutation;
230231
}),
231-
mergeMap((value) => (value === null ? EMPTY : of(value))),
232232
);
233233
}
234234

0 commit comments

Comments
 (0)