v0.12.9: Completion Gate 架构修复 + 工作空间文件夹选择 + 搜索/Plan 全链路加固
Fix: - Completion Gate read_file 误报消除 — 缩窄匹配为仅明确工具声明 + 写后读豁免 - Gate 阻断重试消息重写 — 待办中与 Gate 拦截匹配时明确要求调工具而非模糊修正 - FileWriteDedupHook (pre_tool) + PlanAutoTrackHook (post_tool) — Harness 插件化 - 工作空间浏览按钮修复 — openFile→openDirectory,原生文件夹选择对话框 - pre_tool Hook 执行结果可阻断 — HookResult.passed=false 时拦截工具执行 - Plan 步骤上限 6 + 动词过滤 + 阶段标题过滤 — 适配不同模型格式 - Plan Mode 任务描述固化到系统提示词 — 压缩后不丢失任务目标 - 全部完成信号去重 — system 消息不重复注入 - handleReflecting 空响应 pop() 精确定位最后 assistant 消息 Refactor: - agent-engine.ts 移除全部硬编码模块变量和函数 — 迁移到 Hook 系统 - extractPlanSteps 增加 ACTION_VERBS 动词过滤 - Plan rejection 不再重置 loopCount
This commit is contained in:
@@ -130,6 +130,14 @@ export async function setupIPC(): Promise<void> {
|
||||
return result.filePath;
|
||||
});
|
||||
|
||||
ipcMain.handle('dialog:openDirectory', async () => {
|
||||
const result = await dialog.showOpenDialog(mainWindow!, {
|
||||
properties: ['openDirectory']
|
||||
});
|
||||
if (result.canceled) return null;
|
||||
return result.filePaths;
|
||||
});
|
||||
|
||||
ipcMain.handle('fs:readFile', async (_, filePath: string) => {
|
||||
try {
|
||||
const check = checkPathAllowed(path.resolve(filePath), 'read');
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ export function createMenu(): void {
|
||||
dialog.showMessageBox(mainWindow!, {
|
||||
type: 'info',
|
||||
title: '关于 Metona Ollama',
|
||||
message: 'Metona Ollama Desktop v0.12.5',
|
||||
message: 'Metona Ollama Desktop v0.12.9',
|
||||
detail: 'TypeScript + Electron Ollama AI 聊天客户端\n\nhttps://gitee.com/thzxx/metona-ollama',
|
||||
icon: getIconPath()
|
||||
});
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ contextBridge.exposeInMainWorld('metonaDesktop', {
|
||||
},
|
||||
dialog: {
|
||||
openFile: (options?: unknown) => ipcRenderer.invoke('dialog:openFile', options),
|
||||
saveFile: (options?: unknown) => ipcRenderer.invoke('dialog:saveFile', options)
|
||||
saveFile: (options?: unknown) => ipcRenderer.invoke('dialog:saveFile', options),
|
||||
openDirectory: () => ipcRenderer.invoke('dialog:openDirectory')
|
||||
},
|
||||
fs: {
|
||||
readFile: (filePath: string) => ipcRenderer.invoke('fs:readFile', filePath),
|
||||
|
||||
Reference in New Issue
Block a user