Skip to content

Commit 7120b0e

Browse files
committed
Revert thinking code changes
1 parent 12e7c01 commit 7120b0e

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

cli/src/utils/block-operations.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ import type {
1212
TextContentBlock,
1313
} from '../types/chat'
1414

15-
const SHORT_THINKING_LINE_THRESHOLD = 5
16-
const SHORT_THINKING_CHAR_LIMIT = 500
17-
18-
/**
19-
* Returns true if the thinking content is short enough to stay uncollapsed.
20-
*/
21-
export const isShortThinkingContent = (content: string): boolean => {
22-
const trimmed = content.trim()
23-
return trimmed.split('\n').length <= SHORT_THINKING_LINE_THRESHOLD && trimmed.length <= SHORT_THINKING_CHAR_LIMIT
24-
}
25-
2615
let thinkingIdCounter = 0
2716
const generateThinkingId = (): string => {
2817
thinkingIdCounter++
@@ -245,12 +234,10 @@ const appendTextWithThinkParsingToBlocks = (
245234
const thinkingOpen =
246235
!hasMoreSegments && !textToParse.includes(THINK_CLOSE_TAG)
247236

248-
const closedContent = currentLastBlock.content + firstSegment.content
249237
nextBlocks[nextBlocks.length - 1] = {
250238
...currentLastBlock,
251-
content: closedContent,
239+
content: currentLastBlock.content + firstSegment.content,
252240
thinkingOpen,
253-
...(!thinkingOpen && isShortThinkingContent(closedContent) && { isCollapsed: false }),
254241
}
255242
}
256243
segmentStartIdx = 1
@@ -262,7 +249,6 @@ const appendTextWithThinkParsingToBlocks = (
262249
nextBlocks[nextBlocks.length - 1] = {
263250
...currentLastBlock,
264251
thinkingOpen: false,
265-
...(isShortThinkingContent(currentLastBlock.content) && { isCollapsed: false }),
266252
}
267253
}
268254
}
@@ -399,7 +385,6 @@ export const closeNativeReasoningBlock = (
399385
nextBlocks[lastReasoningIndex] = {
400386
...reasoningBlock,
401387
thinkingOpen: false,
402-
...(isShortThinkingContent(reasoningBlock.content) && { isCollapsed: false }),
403388
}
404389
return nextBlocks
405390
}

cli/src/utils/message-block-helpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { isEqual } from 'lodash'
22

3-
import { isShortThinkingContent } from './block-operations'
43
import { formatToolOutput } from './codebuff-client'
54
import { shouldCollapseByDefault, shouldCollapseForParent } from './constants'
65

0 commit comments

Comments
 (0)