fix(agent): 修复工具也变成在流式输出的问题

This commit is contained in:
肖泽涛 2026-02-25 19:09:04 +08:00
parent 85480dbdc0
commit b0f21309f7

View File

@ -825,7 +825,10 @@ const enqueueLoadingChunkForTyping = (threadId, chunk) => {
}
const msg = chunk.msg || {}
const contentChars = splitChars(msg.content)
const msgType = String(msg.type || '').toLowerCase()
const isToolMessage = msgType === 'tool' || msgType.includes('tool')
const streamText = typeof chunk.response === 'string' ? chunk.response : ''
const contentChars = !isToolMessage ? splitChars(streamText) : []
if (contentChars.length === 0) {
typingChunkQueue.push({ threadId, chunk, isChar: false })
scheduleTypingRender()
@ -838,6 +841,7 @@ const enqueueLoadingChunkForTyping = (threadId, chunk) => {
isChar: true,
chunk: {
...chunk,
response: char,
msg: {
...msg,
content: char