Skip to content

Commit 6d000bc

Browse files
committed
fix: remove unnecessary re-parsing when experiment is off
When using the old parser, parsing already happens during streaming. The finalization step is only needed for the new AssistantMessageParser. This ensures the code executes exactly as before when experiment is disabled.
1 parent 94c316e commit 6d000bc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/core/task/Task.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,10 +1705,8 @@ export class Task extends EventEmitter<TaskEvents> {
17051705
if (this.isAssistantMessageParserEnabled && this.assistantMessageParser) {
17061706
this.assistantMessageParser.finalizeContentBlocks()
17071707
this.assistantMessageContent = this.assistantMessageParser.getContentBlocks()
1708-
} else {
1709-
// When using old parser, parse the complete message
1710-
this.assistantMessageContent = parseAssistantMessage(assistantMessage)
17111708
}
1709+
// When using old parser, no finalization needed - parsing already happened during streaming
17121710

17131711
if (partialBlocks.length > 0) {
17141712
// If there is content to update then it will complete and

0 commit comments

Comments
 (0)