diff --git a/.living_spec/stories/15_new_session_cancellation.md b/.living_spec/stories/archive/15_new_session_cancellation.md similarity index 100% rename from .living_spec/stories/15_new_session_cancellation.md rename to .living_spec/stories/archive/15_new_session_cancellation.md diff --git a/src/components/Chat.tsx b/src/components/Chat.tsx index 9545780..d2c8815 100644 --- a/src/components/Chat.tsx +++ b/src/components/Chat.tsx @@ -197,11 +197,17 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) { ); if (confirmed) { + // Cancel any in-flight backend requests first + try { + await invoke("cancel_chat"); + } catch (e) { + console.error("Failed to cancel chat:", e); + } + + // Then clear frontend state setMessages([]); setStreamingContent(""); setLoading(false); - // TODO: Add backend call to cancel in-flight requests and clear context - // invoke("cancel_chat").catch(console.error); } };