From b87b9c14b7a1fa61eba45106f884491f10f167f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E9=98=B3?= Date: Sat, 9 May 2026 11:49:51 +0800 Subject: [PATCH] Cancel backend run from stop button --- frontend/app/components/assistant-ui/thread.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/app/components/assistant-ui/thread.tsx b/frontend/app/components/assistant-ui/thread.tsx index 592f9ca..14d4b01 100644 --- a/frontend/app/components/assistant-ui/thread.tsx +++ b/frontend/app/components/assistant-ui/thread.tsx @@ -384,6 +384,7 @@ const Composer: FC = () => { const ComposerAction: FC = () => { const runtimeRunning = useAuiState((s) => s.thread.isRunning); const replayedRun = useReplayedRunState(); + const cancelSessionId = replayedRun.sessionId; return (
@@ -414,6 +415,10 @@ const ComposerAction: FC = () => { size="icon" className="aui-composer-cancel size-8 rounded-full" aria-label="Stop generating" + onClick={() => { + if (!cancelSessionId) return; + void cancelLatestRun(cancelSessionId).catch(() => undefined); + }} >