From 8935a248f67d70c1f3892e7eb05aee38c8a11a4c Mon Sep 17 00:00:00 2001 From: Olcan Date: Fri, 30 May 2025 00:46:43 -0700 Subject: allow aborting of shell mode (!) commands, similar to shell tool commands. fix bug that prevented aborts after first abort. more robust killing logic (#616) --- packages/cli/src/ui/hooks/useGeminiStream.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts') diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index afaf0ccd..66fb317a 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -199,7 +199,7 @@ export const useGeminiStream = ( return { queryToSend: null, shouldProceed: false }; // Handled by scheduling the tool } - if (shellModeActive && handleShellCommand(trimmedQuery)) { + if (shellModeActive && handleShellCommand(trimmedQuery, signal)) { return { queryToSend: null, shouldProceed: false }; } @@ -492,7 +492,7 @@ export const useGeminiStream = ( const userMessageTimestamp = Date.now(); setShowHelp(false); - abortControllerRef.current ??= new AbortController(); + abortControllerRef.current = new AbortController(); const signal = abortControllerRef.current.signal; const { queryToSend, shouldProceed } = await prepareQueryForGemini( -- cgit v1.2.3