Skip to content

Commit 57dc84c

Browse files
committed
fix: auto collapse thinking
1 parent a9a40a3 commit 57dc84c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cli/src/hooks/use-send-message.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,16 @@ export const useSendMessage = ({
681681
return
682682
}
683683

684+
// Auto-collapse thinking blocks on first reasoning content
685+
if (delta.type === 'reasoning') {
686+
autoCollapseThinkingBlock(
687+
aiMessageId,
688+
undefined,
689+
autoCollapsedThinkingIdsRef,
690+
setCollapsedAgents,
691+
)
692+
}
693+
684694
queueMessageUpdate((prev) =>
685695
prev.map((msg) => {
686696
if (msg.id !== aiMessageId) {
@@ -854,16 +864,6 @@ export const useSendMessage = ({
854864
(rootStreamBufferRef.current ?? '') + eventObj.text
855865
}
856866

857-
// Auto-collapse thinking blocks by default (only once per thinking block)
858-
if (eventObj.type === 'reasoning') {
859-
autoCollapseThinkingBlock(
860-
aiMessageId,
861-
undefined,
862-
autoCollapsedThinkingIdsRef,
863-
setCollapsedAgents,
864-
)
865-
}
866-
867867
rootStreamSeenRef.current = true
868868
appendRootChunk(eventObj)
869869
} else if (event.type === 'subagent_chunk') {

0 commit comments

Comments
 (0)