fix chat reasoning not splitting after tool calls

This commit is contained in:
Nicolas Mowen
2026-12-02 16:58:38 -07:00
parent 9b386acaf1
commit a74b1e9f55
4 changed files with 193 additions and 20 deletions
+4 -2
View File
@@ -34,9 +34,10 @@ export function ReasoningBubble({
const { t } = useTranslation(["views/chat"]);
// Open while the model is still mid-thought (no answer tokens yet);
// once the answer begins, collapse on its own but let the user reopen.
const [open, setOpen] = useState(true);
// Reasoning that is already finished on mount starts collapsed.
const [open, setOpen] = useState(!answerStarted);
const userInteractedRef = useRef(false);
const lastAutoState = useRef(true);
const lastAutoState = useRef(!answerStarted);
useEffect(() => {
if (userInteractedRef.current) return;
@@ -66,6 +67,7 @@ export function ReasoningBubble({
<Button
variant="ghost"
size="sm"
aria-label={label}
className="h-auto w-full min-w-0 justify-start gap-2 whitespace-normal p-0 text-left text-xs hover:bg-transparent"
>
<Tooltip>