feat: 逻辑优化

This commit is contained in:
digua
2025-12-06 02:20:11 +08:00
parent 5618bf7be4
commit cd2dc0b8db
12 changed files with 361 additions and 292 deletions
+7 -5
View File
@@ -476,11 +476,13 @@ export function registerAIHandlers({ win }: IpcContext): void {
if (abortController.signal.aborted) {
return
}
aiLogger.debug('IPC', `Agent chunk: ${requestId}`, {
type: chunk.type,
contentLength: chunk.content?.length,
toolName: chunk.toolName,
})
// 减少日志噪音:只在工具调用时记录
if (chunk.type === 'tool_start' || chunk.type === 'tool_result') {
aiLogger.debug('IPC', `Agent chunk: ${requestId}`, {
type: chunk.type,
toolName: chunk.toolName,
})
}
win.webContents.send('agent:streamChunk', { requestId, chunk })
})