fix: unexpected loading (#9193)

fix
This commit is contained in:
SuYao 2025-08-15 09:28:43 +08:00 committed by GitHub
parent 5d34e49c57
commit d1e19aad51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -104,9 +104,9 @@ async function fetchExternalTool(
const showListTools = enabledMCPs && enabledMCPs.length > 0
// 是否使用工具
const hasAnyTool = shouldWebSearch || shouldKnowledgeSearch || shouldSearchMemory || showListTools
const hasAnyTool = shouldWebSearch || shouldKnowledgeSearch || showListTools
// 在工具链开始时发送进度通知
// 在工具链开始时发送进度通知(不包括记忆搜索)
if (hasAnyTool) {
onChunkReceived({ type: ChunkType.EXTERNEL_TOOL_IN_PROGRESS })
}
@ -456,8 +456,6 @@ export async function fetchChatCompletion({
const { mcpTools } = await fetchExternalTool(lastUserMessage, assistant, onChunkReceived, lastAnswer)
const model = assistant.model || getDefaultModel()
onChunkReceived({ type: ChunkType.LLM_RESPONSE_CREATED })
const { maxTokens, contextCount } = getAssistantSettings(assistant)
const filteredMessages2 = filterUsefulMessages(filteredMessages1)
@ -488,7 +486,7 @@ export async function fetchChatCompletion({
isGenerateImageModel(model) && (isSupportedDisableGenerationModel(model) ? assistant.enableGenerateImage : true)
// --- Call AI Completions ---
onChunkReceived({ type: ChunkType.LLM_RESPONSE_CREATED })
const completionsParams: CompletionsParams = {
callType: 'chat',
messages: _messages,

View File

@ -40,6 +40,7 @@ export const createCitationCallbacks = (deps: CitationCallbacksDependencies) =>
status: MessageBlockStatus.SUCCESS
}
blockManager.smartBlockUpdate(citationBlockId, changes, MessageBlockType.CITATION, true)
citationBlockId = null
} else {
logger.error('[onExternalToolComplete] citationBlockId is null. Cannot update.')
}