From 2ac07208b59423fc39f11dc84b05b877e6acad53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B4=AB=E5=BD=B1233?= Date: Thu, 16 Jul 2026 14:31:19 +0800 Subject: [PATCH] =?UTF-8?q?v0.16.8:=20Agent=20Loop=20P0-P3=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20+=20=E6=AD=BB=E4=BB=A3=E7=A0=81=E6=B8=85=E7=90=86?= =?UTF-8?q?=20+=20=E7=89=88=E6=9C=AC=E5=8F=B7=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - P0: executeToolWithTimeout 重写为 Promise.race,实现真正超时中断 - P1 #2: R8 紧急压缩限制最多 2 次,防止溢出→压缩→重试无限循环 - P1 #3: 新增 snapshotSafetyState/restoreSafetyState,Sub-Agent 在隔离环境中运行 - P1 #4: persistLoopContext 中止时持久化 TERMINATED 状态 - P1 #5: Completion Gate 失败时注入纠正提示并重试(最多 1 次) - P2 #6: executeSingleTool 重试逻辑兜底返回完善 - P2 #7: 压缩阈值提高(0.3→0.5, 0.8→0.85)+ compressedThisCycle 防同轮重复压缩 - P2 #8: 路径依赖检查优先于 ALWAYS_PARALLEL,防止读写同路径被错误并行 - P2 #9: R105 消息年龄追踪改为内容哈希 key(后被确认为死代码并清理) - P3 #11: ctx_tokens 统一语义为 prompt_eval_count - P3 #12: 自动记忆提取捕获 signal 引用,避免竞态 - P3 #13: verifyToolResult 返回警告字符串供 Completion Gate 使用 - 注入消毒增强:零宽字符移除、全角→半角、新增覆盖模式 - 死代码清理:R105 上下文年龄追踪系列函数(无任何调用点) - 版本号 0.16.7 → 0.16.8(package.json/lock, menu.ts, index.html, README.md) --- README.md | 6 +- package-lock.json | 4 +- package.json | 2 +- src/main/menu.ts | 2 +- src/renderer/index.html | 2 +- src/renderer/services/agent-engine.ts | 198 ++++++++++++++++------- src/renderer/services/agent-safety.ts | 97 ++++++----- src/renderer/services/context-manager.ts | 20 ++- src/renderer/services/sub-agent.ts | 9 +- src/renderer/types.d.ts | 8 + 10 files changed, 230 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index 64c22fa..2623f0a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@

- version + version electron typescript license @@ -253,7 +253,7 @@ npm start ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm run dist ``` -产出:`release/Metona Ollama Setup v0.16.7.exe` +产出:`release/Metona Ollama Setup v0.16.8.exe` ## 🛠️ 常用命令 @@ -501,7 +501,7 @@ npm start ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm run dist ``` -Output: `release/Metona Ollama Setup v0.16.7.exe` +Output: `release/Metona Ollama Setup v0.16.8.exe` ## 🛠️ Common Commands diff --git a/package-lock.json b/package-lock.json index be3b98c..3f6c37b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "metona-ollama-desktop", - "version": "0.16.7", + "version": "0.16.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "metona-ollama-desktop", - "version": "0.16.7", + "version": "0.16.8", "license": "MIT", "dependencies": { "ffmpeg-static": "^5.2.0", diff --git a/package.json b/package.json index 671b2fb..bcb1e4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metona-ollama-desktop", - "version": "0.16.7", + "version": "0.16.8", "description": "Metona Ollama - TypeScript + Electron 桌面 AI 聊天客户端", "main": "dist/main/main.js", "author": "thzxx", diff --git a/src/main/menu.ts b/src/main/menu.ts index 10525d6..e8c2706 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -101,7 +101,7 @@ export function createMenu(): void { dialog.showMessageBox(mainWindow!, { type: 'info', title: '关于 Metona Ollama', - message: 'Metona Ollama Desktop v0.16.7', + message: 'Metona Ollama Desktop v0.16.8', detail: 'TypeScript + Electron Ollama AI 聊天客户端\n\nhttps://gitee.com/thzxx/metona-ollama', icon: getIconPath() }); diff --git a/src/renderer/index.html b/src/renderer/index.html index e423dcc..70915b2 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -28,7 +28,7 @@

Metona Ollama - v0.16.7 + v0.16.8