From c530e5d50f5a77cd732c0c3e09d9ef964faea96e Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 2 Mar 2026 13:32:27 -0800 Subject: [PATCH] Guard commitRename cleanup against concurrent renames After the async dispatch, only clear renamingThreadId if it still matches the thread being renamed, preventing a second rename's input from being cleared by the first's completion. Co-Authored-By: Claude Opus 4.6 --- apps/web/src/components/Sidebar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index cdd39ceb9d7468a892881deb4d5ac76ef6186a7f..21c9005057c6fb424d3a45847af2d2a11154a5a8 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -543,7 +543,11 @@ export default function Sidebar() { description: error instanceof Error ? error.message : "An error occurred.", }); } - cancelRename(); + setRenamingThreadId((current) => { + if (current !== threadId) return current; + renamingInputRef.current = null; + return null; + }); }, [cancelRename], ); -- 2.54.0