summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-05-27 15:40:18 -0700
committerGitHub <[email protected]>2025-05-27 15:40:18 -0700
commitbfeaac844186153698d3a7079b41214bbf1e4371 (patch)
treeb7b5208072de7f43eb45d9e7a2fe64b1febee42f /packages/cli/src/ui/hooks/useGeminiStream.ts
parent0d5f7686d7c4cd355cc2d327a2f04c8d7d31e09e (diff)
live output from shell tool (#573)
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts34
1 files changed, 19 insertions, 15 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index f369d796..d91eea3d 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -70,21 +70,25 @@ export const useGeminiStream = (
const [pendingHistoryItemRef, setPendingHistoryItem] =
useStateAndRef<HistoryItemWithoutId | null>(null);
const logger = useLogger();
- const [toolCalls, schedule, cancel] = useToolScheduler((tools) => {
- if (tools.length) {
- addItem(mapToDisplay(tools), Date.now());
- submitQuery(
- tools
- .filter(
- (t) =>
- t.status === 'error' ||
- t.status === 'cancelled' ||
- t.status === 'success',
- )
- .map((t) => t.response.responsePart),
- );
- }
- }, config);
+ const [toolCalls, schedule, cancel] = useToolScheduler(
+ (tools) => {
+ if (tools.length) {
+ addItem(mapToDisplay(tools), Date.now());
+ submitQuery(
+ tools
+ .filter(
+ (t) =>
+ t.status === 'error' ||
+ t.status === 'cancelled' ||
+ t.status === 'success',
+ )
+ .map((t) => t.response.responsePart),
+ );
+ }
+ },
+ config,
+ setPendingHistoryItem,
+ );
const pendingToolCalls = useMemo(
() => (toolCalls.length ? mapToDisplay(toolCalls) : undefined),
[toolCalls],