From cc143550a9dbc453b55d0e8aa6f4c54dae4f690f Mon Sep 17 00:00:00 2001 From: Philip Zeyliger Date: Sat, 3 Jan 2026 05:47:09 +0000 Subject: [PATCH] shelley: reset context window size when switching to new conversation Prompt: In a new worktree, make sure that the usage meter is tied to the relevant conversation. Currently it's not by conversation id, so the latest shows up incorrectly The usage meter (context window progress bar) was showing stale data from the previous conversation when the user started a new conversation. This was because the contextWindowSize state was not reset to 0 when the conversationId became null. Fixed by adding setContextWindowSize(0) in the useEffect that handles conversation changes, alongside the existing setMessages([]) call. --- ui/src/components/ChatInterface.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/components/ChatInterface.tsx b/ui/src/components/ChatInterface.tsx index ee4b7263eadbca5c98da960469ebc4e83147222c..501a0f05cd24e7022180509c74112ea2e52b3ac0 100644 --- a/ui/src/components/ChatInterface.tsx +++ b/ui/src/components/ChatInterface.tsx @@ -461,6 +461,7 @@ function ChatInterface({ } else { // No conversation yet, show empty state setMessages([]); + setContextWindowSize(0); setLoading(false); }