feat: 工具卡片精简、移除token统计、消息时间显示
1. 聊天消息工具卡片只显示工具名+调用内容,不显示执行结果(工作空间工具页签已有完整结果) 2. 移除所有token统计相关代码:顶栏统计、消息内token/耗时显示、历史记录中的token显示 3. 每条消息显示具体时间(年月日 时分秒),formatTime 已含秒数
This commit is contained in:
@@ -8,7 +8,7 @@ import { detectLanguage, truncate, escapeHtml, formatSize } from '../utils/utils
|
||||
import { getSelectedModel, isThinkEnabled, isVisionAvailable, isToolCallingSupported } from './model-bar.js';
|
||||
import {
|
||||
renderMessages, clearMessagesDOM, appendAssistantPlaceholder, appendSystemMessage,
|
||||
updateLastAssistantMessage, clearMessages, safeMarkdown, enableAutoScroll, updateTotalTokens,
|
||||
updateLastAssistantMessage, clearMessages, safeMarkdown, enableAutoScroll,
|
||||
appendToolCallCardToPlaceholder, updateToolCallCardInPlaceholder, resetCurrentPlaceholder
|
||||
} from './chat-area.js';
|
||||
import { showToast } from './toast.js';
|
||||
@@ -371,7 +371,6 @@ async function handleRetry(): Promise<void> {
|
||||
}
|
||||
renderMessages();
|
||||
await saveCurrentSession();
|
||||
updateTotalTokens();
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -424,7 +423,6 @@ async function handleUndo(): Promise<void> {
|
||||
|
||||
clearMessagesDOM();
|
||||
renderMessages();
|
||||
updateTotalTokens();
|
||||
showToast('已撤销上一轮对话', 'success');
|
||||
}
|
||||
|
||||
@@ -503,7 +501,6 @@ async function handleCompress(): Promise<void> {
|
||||
|
||||
clearMessagesDOM();
|
||||
renderMessages();
|
||||
updateTotalTokens();
|
||||
|
||||
logInfo(`上下文压缩完成: ${middle.length} 条 → 1 条摘要`);
|
||||
showToast(`已压缩 ${middle.length} 条消息为摘要`, 'success');
|
||||
@@ -754,7 +751,6 @@ export async function sendMessage(): Promise<void> {
|
||||
}
|
||||
|
||||
await saveCurrentSession();
|
||||
updateTotalTokens();
|
||||
|
||||
// ── 自动提取记忆(非阻塞)──
|
||||
if (isMemoryEnabled() && freshSession.messages.length >= 10) {
|
||||
@@ -1096,7 +1092,6 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
|
||||
}
|
||||
renderMessages();
|
||||
await saveCurrentSession();
|
||||
updateTotalTokens();
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user