Skip to content

Commit ff4deec

Browse files
committed
Fix: Escape on ask_user form now interrupts assistant stream
Previously, pressing Escape to skip an ask_user question only dismissed the form but the assistant kept running. Now Escape both skips the question and aborts the assistant stream, returning the user to the input box.
1 parent 2c6978e commit ff4deec

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cli/src/chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,7 @@ export const Chat = ({
15251525
},
15261526
cwd: getProjectRoot() ?? process.cwd(),
15271527
})}
1528+
onInterruptStream={chatKeyboardHandlers.onInterruptStream}
15281529
/>
15291530
)}
15301531
</box>

cli/src/components/chat-input-bar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ interface ChatInputBarProps {
7171
// Handlers
7272
handleSubmit: () => Promise<void>
7373
onPaste: (fallbackText?: string) => void
74+
onInterruptStream: () => void
7475
}
7576

7677
export const ChatInputBar = ({
@@ -108,6 +109,7 @@ export const ChatInputBar = ({
108109
handlePublish,
109110
handleSubmit,
110111
onPaste,
112+
onInterruptStream,
111113
}: ChatInputBarProps) => {
112114
const inputMode = useChatStore((state) => state.inputMode)
113115
const setInputMode = useChatStore((state) => state.setInputMode)
@@ -290,6 +292,7 @@ export const ChatInputBar = ({
290292
const handleFormSkip = () => {
291293
if (!askUserState) return
292294
skip()
295+
onInterruptStream()
293296
}
294297

295298
const effectivePlaceholder =

0 commit comments

Comments
 (0)