Skip to content

Commit 4f8a916

Browse files
committed
yield chunk after the early-exit check
1 parent 017cf3a commit 4f8a916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mcp-client/src/McpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export class McpClient {
145145
if (opts.abortSignal?.aborted) {
146146
throw new Error("AbortError");
147147
}
148-
yield chunk;
149148
debug(chunk.choices[0]);
150149
numOfChunks++;
151150
const delta = chunk.choices[0]?.delta;
@@ -174,6 +173,7 @@ export class McpClient {
174173
/// If no tool is present in chunk number 1 or 2, exit.
175174
return;
176175
}
176+
yield chunk;
177177
}
178178

179179
messages.push(message);

0 commit comments

Comments
 (0)