From 118153ecfd79279bb7a7ac0ed5d987b98a189556 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 26 Mar 2026 15:53:50 -0700 Subject: [PATCH 1/4] fix: hide "compact conversation" when there's no conversation history When the system message is large, context percentage can exceed 60% even on the first exchange, causing the "Compact conversation" label and link to appear when there's nothing meaningful to compact. Now requires at least 2 user messages before showing compact UI elements. --- gui/src/components/StepContainer/ResponseActions.tsx | 6 +++++- gui/src/components/mainInput/ContextStatus.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/src/components/StepContainer/ResponseActions.tsx b/gui/src/components/StepContainer/ResponseActions.tsx index 0dc09a438be..8cce6007146 100644 --- a/gui/src/components/StepContainer/ResponseActions.tsx +++ b/gui/src/components/StepContainer/ResponseActions.tsx @@ -40,6 +40,9 @@ export default function ResponseActions({ (state) => state.session.contextPercentage, ); const isPruned = useAppSelector((state) => state.session.isPruned); + const historyLength = useAppSelector( + (state) => state.session.history.length, + ); const ruleGenerationSupported = useMemo(() => { return selectedModel && modelSupportsNativeTools(selectedModel); }, [selectedModel]); @@ -50,7 +53,8 @@ export default function ResponseActions({ ? "text-warning" : "text-description-muted"; - const showLabel = isLast && (isPruned || percent >= 60); + const showLabel = + isLast && historyLength >= 4 && (isPruned || percent >= 60); const compactConversation = useCompactConversation(); diff --git a/gui/src/components/mainInput/ContextStatus.tsx b/gui/src/components/mainInput/ContextStatus.tsx index 63be8f18000..049ac81c25a 100644 --- a/gui/src/components/mainInput/ContextStatus.tsx +++ b/gui/src/components/mainInput/ContextStatus.tsx @@ -61,7 +61,7 @@ const ContextStatus = () => { {`Oldest messages are being removed.`} )} - {history.length > 0 && ( + {history.length >= 4 && (
Date: Thu, 26 Mar 2026 16:33:26 -0700 Subject: [PATCH 2/4] fix: format files with prettier/tailwindcss plugin --- .../components/StepContainer/ResponseActions.tsx | 15 ++++++--------- gui/src/components/mainInput/ContextStatus.tsx | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gui/src/components/StepContainer/ResponseActions.tsx b/gui/src/components/StepContainer/ResponseActions.tsx index 8cce6007146..7e0775c0214 100644 --- a/gui/src/components/StepContainer/ResponseActions.tsx +++ b/gui/src/components/StepContainer/ResponseActions.tsx @@ -40,9 +40,7 @@ export default function ResponseActions({ (state) => state.session.contextPercentage, ); const isPruned = useAppSelector((state) => state.session.isPruned); - const historyLength = useAppSelector( - (state) => state.session.history.length, - ); + const historyLength = useAppSelector((state) => state.session.history.length); const ruleGenerationSupported = useMemo(() => { return selectedModel && modelSupportsNativeTools(selectedModel); }, [selectedModel]); @@ -53,8 +51,7 @@ export default function ResponseActions({ ? "text-warning" : "text-description-muted"; - const showLabel = - isLast && historyLength >= 4 && (isPruned || percent >= 60); + const showLabel = isLast && historyLength >= 4 && (isPruned || percent >= 60); const compactConversation = useCompactConversation(); @@ -64,7 +61,7 @@ export default function ResponseActions({ }; return ( -
+
- + )} @@ -105,7 +102,7 @@ export default function ResponseActions({ text="Continue generation" onClick={onContinueGeneration} > - + )} @@ -115,7 +112,7 @@ export default function ResponseActions({ tabIndex={-1} onClick={onDelete} > - + {
compactConversation(history.length - 1)} > Compact conversation {"\n"} { void dispatch( saveCurrentSession({ @@ -90,7 +90,7 @@ const ContextStatus = () => {
} > -
+
Date: Thu, 26 Mar 2026 16:37:25 -0700 Subject: [PATCH 3/4] fix: reformat with root prettier config to match CI --- gui/src/components/StepContainer/ResponseActions.tsx | 8 ++++---- gui/src/components/mainInput/ContextStatus.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gui/src/components/StepContainer/ResponseActions.tsx b/gui/src/components/StepContainer/ResponseActions.tsx index 7e0775c0214..ac28afb9dc1 100644 --- a/gui/src/components/StepContainer/ResponseActions.tsx +++ b/gui/src/components/StepContainer/ResponseActions.tsx @@ -61,7 +61,7 @@ export default function ResponseActions({ }; return ( -
+
- + )} @@ -102,7 +102,7 @@ export default function ResponseActions({ text="Continue generation" onClick={onContinueGeneration} > - + )} @@ -112,7 +112,7 @@ export default function ResponseActions({ tabIndex={-1} onClick={onDelete} > - + {
compactConversation(history.length - 1)} > Compact conversation {"\n"} { void dispatch( saveCurrentSession({ @@ -90,7 +90,7 @@ const ContextStatus = () => {
} > -
+
Date: Thu, 26 Mar 2026 16:41:10 -0700 Subject: [PATCH 4/4] fix: show "Start a new session" for all history lengths "Compact conversation" still requires history.length >= 4, but "Start a new session" should be available whenever there is any conversation history. --- .../components/mainInput/ContextStatus.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gui/src/components/mainInput/ContextStatus.tsx b/gui/src/components/mainInput/ContextStatus.tsx index 049ac81c25a..d036c2e2900 100644 --- a/gui/src/components/mainInput/ContextStatus.tsx +++ b/gui/src/components/mainInput/ContextStatus.tsx @@ -61,16 +61,20 @@ const ContextStatus = () => { {`Oldest messages are being removed.`} )} - {history.length >= 4 && ( + {history.length > 0 && (
- compactConversation(history.length - 1)} - > - Compact conversation - - {"\n"} + {history.length >= 4 && ( + <> + compactConversation(history.length - 1)} + > + Compact conversation + + {"\n"} + + )} {