Skip to content

Commit e765961

Browse files
committed
update tests
1 parent edb3a1f commit e765961

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

typescript-sdk/packages/client/src/middleware/filter-tool-calls.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { AbstractAgent } from "@/agent";
33
import { RunAgentInput, BaseEvent, EventType, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, ToolCallResultEvent } from "@ag-ui/core";
44
import { Observable } from "rxjs";
55
import { filter } from "rxjs/operators";
6-
import { transformChunks } from "@/chunks";
76

87
type FilterToolCallsConfig =
98
| { allowedToolCalls: string[]; disallowedToolCalls?: never }
@@ -34,9 +33,8 @@ export class FilterToolCallsMiddleware extends Middleware {
3433
}
3534

3635
public run(input: RunAgentInput, next: AbstractAgent): Observable<BaseEvent> {
37-
// Apply transformChunks first to convert TOOL_CALL_CHUNK events
38-
return next.run(input).pipe(
39-
transformChunks(false),
36+
// Use runNext which already includes transformChunks
37+
return this.runNext(input, next).pipe(
4038
filter((event) => {
4139
// Handle TOOL_CALL_START events
4240
if (event.type === EventType.TOOL_CALL_START) {

0 commit comments

Comments
 (0)