chore: 清理死代码,retry handler 工具卡片渲染补全

- 移除 agent-engine.ts 中未使用的 logThink 导入
- 移除 settings-modal.ts 中未使用的 isVectorMemoryEnabled 导入
- 修复 retry handler 中 onToolCallStart/onToolCallResult/onToolCallError 空回调
This commit is contained in:
thzxx
2026-04-19 17:21:55 +08:00
parent c60ee2b4ae
commit f817abd5e1
3 changed files with 20 additions and 5 deletions
+18 -3
View File
@@ -286,9 +286,24 @@ async function handleRetry(): Promise<void> {
await runAgentLoop(userMsg.content || '', userMsg.images || [], historyMessages, {
onThinking: (thinking) => updateLastAssistantMessage('', thinking, null),
onContent: (content) => updateLastAssistantMessage(content, null, null),
onToolCallStart: () => {},
onToolCallResult: () => {},
onToolCallError: () => {},
onToolCallStart: (call) => {
appendToolCallCardToPlaceholder({
name: call.function.name, arguments: call.function.arguments,
result: null, status: 'running', timestamp: Date.now()
});
},
onToolCallResult: (name, result, call) => {
updateToolCallCardInPlaceholder({
name, arguments: call.function.arguments,
result, status: result.success ? 'success' : 'error', timestamp: Date.now()
});
},
onToolCallError: (name, error, call) => {
updateToolCallCardInPlaceholder({
name, arguments: call.function.arguments,
result: { success: false, error }, status: 'error', timestamp: Date.now()
});
},
onConfirmTool: async (call) => showToolConfirm(call),
onDone: async (finalContent, toolRecords, loopStats) => {
const assistantMsg: ChatMessage = {