summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/gemini.tsx8
-rw-r--r--packages/cli/src/ui/hooks/useToolScheduler.ts7
2 files changed, 10 insertions, 5 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx
index 11875593..9cfaef37 100644
--- a/packages/cli/src/gemini.tsx
+++ b/packages/cli/src/gemini.tsx
@@ -95,9 +95,11 @@ async function main() {
const geminiClient = new GeminiClient(config);
const chat = await geminiClient.startChat();
try {
- for await (const event of geminiClient.sendMessageStream(chat, [
- { text: input },
- ])) {
+ for await (const event of geminiClient.sendMessageStream(
+ chat,
+ [{ text: input }],
+ new AbortController().signal,
+ )) {
if (event.type === 'content') {
process.stdout.write(event.value);
}
diff --git a/packages/cli/src/ui/hooks/useToolScheduler.ts b/packages/cli/src/ui/hooks/useToolScheduler.ts
index f1eee9fd..7d8cfbe4 100644
--- a/packages/cli/src/ui/hooks/useToolScheduler.ts
+++ b/packages/cli/src/ui/hooks/useToolScheduler.ts
@@ -142,7 +142,10 @@ export function useToolScheduler(
const { request: r, tool } = initialCall;
try {
- const userApproval = await tool.shouldConfirmExecute(r.args);
+ const userApproval = await tool.shouldConfirmExecute(
+ r.args,
+ abortController.signal,
+ );
if (userApproval) {
// Confirmation is needed. Update status to 'awaiting_approval'.
setToolCalls(
@@ -183,7 +186,7 @@ export function useToolScheduler(
}
});
},
- [isRunning, setToolCalls, toolRegistry],
+ [isRunning, setToolCalls, toolRegistry, abortController.signal],
);
const cancel = useCallback(