- P0: 发送路径用户消息重复注入根治(history-builder 纯模块 + 单测,连带修复 maxCount 截断保留最旧消息缺陷);/undo、/retry 消息删除差量落库(新增 db:getMessageIds/deleteMessages 四层通道);/compress 摘要 role:user + 可折叠卡片渲染 + 旧 system 行读取归一化 - P1: memory search 默认 limit=8;工具缓存键/去重改稳定序列化;run_command 超时联动主进程杀子进程;记忆访问统计写回纳入写入锁;搜索自动抓取单页限幅 8k;Token 趋势采样移出 calculateContextStats 并记录裁剪后值;空白 assistant 幽灵消息跳过入库(新迭代/中止两路径) - P2: 新增 tool-security(18 用例,平台自适应)与 history-builder(11 用例)测试;帮助/README/DEVELOPMENT 文案与代码事实对齐;vendor 失效 sourcemap 与 .npmrc 弃用配置清理;备份导入携带 attachments 修复 - 版本号升级 0.17.2(5 文件白名单);typecheck 零错误 / 301 测试通过 / 构建通过
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
import type { OllamaMessage } from '../types.js';
|
||||
import { logInfo } from './log-service.js';
|
||||
import { stableStringify } from '../utils/utils.js';
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
// R51: 工具结果离线存储
|
||||
@@ -60,7 +61,7 @@ const _toolCallHistory: string[] = [];
|
||||
|
||||
/** 记录工具调用到历史序列(供快照/恢复) */
|
||||
export function recordToolCallHistory(toolName: string, args: Record<string, unknown>): void {
|
||||
const key = `${toolName}:${JSON.stringify(args, Object.keys(args).sort()).slice(0, 100)}`;
|
||||
const key = `${toolName}:${stableStringify(args).slice(0, 100)}`;
|
||||
_toolCallHistory.push(key);
|
||||
if (_toolCallHistory.length > 8) _toolCallHistory.shift();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user