@@ -164,6 +164,7 @@ import { ProviderHealthBanner } from "./chat/ProviderHealthBanner";
164164import { ThreadErrorBanner } from "./chat/ThreadErrorBanner" ;
165165import {
166166 buildExpiredTerminalContextToastCopy ,
167+ buildRunningTurnBlockedMessage ,
167168 buildLocalDraftThread ,
168169 buildTemporaryWorktreeBranchName ,
169170 cloneComposerImageForRetry ,
@@ -661,6 +662,8 @@ export default function ChatView({ threadId }: ChatViewProps) {
661662 const isSendBusy = sendPhase !== "idle" ;
662663 const isPreparingWorktree = sendPhase === "preparing-worktree" ;
663664 const isWorking = phase === "running" || isSendBusy || isConnecting || isRevertingCheckpoint ;
665+ const hasRunningTerminalSubprocess = terminalState . runningTerminalIds . length > 0 ;
666+ const runningTurnBlockedMessage = buildRunningTurnBlockedMessage ( hasRunningTerminalSubprocess ) ;
664667 const nowIso = new Date ( nowTick ) . toISOString ( ) ;
665668 const activeWorkStartedAt = deriveActiveWorkStartedAt (
666669 activeLatestTurn ,
@@ -2346,6 +2349,10 @@ export default function ChatView({ threadId }: ChatViewProps) {
23462349 e ?. preventDefault ( ) ;
23472350 const api = readNativeApi ( ) ;
23482351 if ( ! api || ! activeThread || isSendBusy || isConnecting || sendInFlightRef . current ) return ;
2352+ if ( phase === "running" ) {
2353+ setThreadError ( activeThread . id , runningTurnBlockedMessage ) ;
2354+ return ;
2355+ }
23492356 if ( activePendingProgress ) {
23502357 onAdvanceActivePendingUserInput ( ) ;
23512358 return ;
@@ -3931,22 +3938,29 @@ export default function ChatView({ threadId }: ChatViewProps) {
39313938 </ Button >
39323939 </ div >
39333940 ) : phase === "running" ? (
3934- < button
3935- type = "button"
3936- className = "flex size-8 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:bg-rose-500 hover:scale-105 sm:h-8 sm:w-8"
3937- onClick = { ( ) => void onInterrupt ( ) }
3938- aria-label = "Stop generation"
3939- >
3940- < svg
3941- width = "12"
3942- height = "12"
3943- viewBox = "0 0 12 12"
3944- fill = "currentColor"
3945- aria-hidden = "true"
3941+ < div className = "flex items-center gap-2" >
3942+ < span className = "hidden max-w-52 text-right text-xs text-muted-foreground/70 sm:inline" >
3943+ { runningTurnBlockedMessage }
3944+ </ span >
3945+ < button
3946+ type = "button"
3947+ className = "flex h-9 cursor-pointer items-center justify-center gap-2 rounded-full bg-rose-500/90 px-3 text-white transition-all duration-150 hover:bg-rose-500 hover:scale-105 sm:h-8"
3948+ onClick = { ( ) => void onInterrupt ( ) }
3949+ aria-label = "Stop generation"
3950+ title = { runningTurnBlockedMessage }
39463951 >
3947- < rect x = "2" y = "2" width = "8" height = "8" rx = "1.5" />
3948- </ svg >
3949- </ button >
3952+ < svg
3953+ width = "12"
3954+ height = "12"
3955+ viewBox = "0 0 12 12"
3956+ fill = "currentColor"
3957+ aria-hidden = "true"
3958+ >
3959+ < rect x = "2" y = "2" width = "8" height = "8" rx = "1.5" />
3960+ </ svg >
3961+ < span className = "hidden sm:inline" > Stop</ span >
3962+ </ button >
3963+ </ div >
39503964 ) : pendingUserInputs . length === 0 ? (
39513965 showPlanFollowUpPrompt ? (
39523966 prompt . trim ( ) . length > 0 ? (
0 commit comments