Skip to content

Commit 03d40db

Browse files
fix endedAt timestamp bug
1 parent c88cb83 commit 03d40db

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function parseBlocks(blocks: ContentBlock[]): MessageSegment[] {
180180
if (!block.content || !group) continue
181181
group.isDelegating = false
182182
const lastItem = group.items[group.items.length - 1]
183-
if (lastItem?.type === 'thinking') {
183+
if (lastItem?.type === 'thinking' && lastItem.endedAt === undefined) {
184184
lastItem.content += block.content
185185
if (block.endedAt !== undefined) lastItem.endedAt = block.endedAt
186186
} else {
@@ -201,7 +201,7 @@ function parseBlocks(blocks: ContentBlock[]): MessageSegment[] {
201201
group = null
202202
}
203203
const last = segments[segments.length - 1]
204-
if (last?.type === 'thinking') {
204+
if (last?.type === 'thinking' && last.endedAt === undefined) {
205205
last.content += block.content
206206
if (block.endedAt !== undefined) last.endedAt = block.endedAt
207207
} else {

0 commit comments

Comments
 (0)