fix(cli): consume the stream returned by send

This commit is contained in:
Adam Weidman
2026-03-20 11:19:34 -04:00
committed by Adam Weidman
parent 6d8cee7620
commit c3b5bcb84c
2 changed files with 30 additions and 2 deletions
+2 -2
View File
@@ -294,7 +294,7 @@ export async function runNonInteractive({
});
// Start the agentic loop (runs in background)
await session.send({
const { streamId } = await session.send({
message: geminiPartsToContentParts(query),
});
@@ -351,7 +351,7 @@ export async function runNonInteractive({
// Consume AgentEvents for output formatting
let responseText = '';
let streamEnded = false;
for await (const event of session.stream()) {
for await (const event of session.stream({ streamId })) {
if (streamEnded) break;
switch (event.type) {
case 'message': {