Commit Graph
377 Commits
Author SHA1 Message Date
thzxx 23918b8223 chore: v0.10.3 — 选择支持think的模型自动启用思考模式, 修复AI回复不显示模型标签, 版本号升级 2026-06-10 13:14:58 +08:00
thzxx f334c6b31e fix: 超时迁移只执行一次——用_timeout_v2_migrated标记避免误迁移用户设置的0 2026-06-10 10:05:50 +08:00
thzxx efb7cc1241 fix: 兼容旧版超时数据——旧版0值自动迁移为-1(默认) 2026-06-10 10:04:46 +08:00
thzxx 3a6516ed76 fix: 超时设置三个输入框独立处理,改一个只打印一条日志 2026-06-10 10:03:04 +08:00
thzxx 99ef9a5078 chore: 超时设置日志改回debug级别 2026-06-10 09:55:32 +08:00
thzxx 0489952ceb fix: 超时设置0值(禁用)无法保存的bug
- 保存值改用-1表示默认, 0表示禁用, 正数表示自定义秒数
- 修复parseSec区分空字符串和0值
- loadTimeoutSettings/main.ts初始化同步更新判断逻辑
- 补全types.d.ts中setTimeouts类型声明
2026-06-10 09:54:20 +08:00
thzxx 9559390d4d fix: 超时设置日志从debug级别改为info级别,初始化时打印汇总日志 2026-06-10 09:51:07 +08:00
thzxx 6390457312 feat: v0.10.2 - 可配置超时设置 + 默认值提升
- HTTP超时: 15s→30s(可配5s~300s), MCP超时: 30s→60s(可配10s~300s), 流式超时: 180s→300s(可配0~600s)
- 设置面板新增超时配置区域(HTTP/流式/MCP),留空使用默认值
- 主进程HTTP_TIMEOUT/MCP_TIMEOUT改为可配置变量,通过IPC setTimeouts通道接收
- 帮助面板/README/release-notes更新四引擎搜索和超时描述
- 版本号同步更新至v0.10.2(16处)
2026-06-10 09:39:59 +08:00
thzxx 64264cc0f8 v0.10.1: 修复显存泄漏 + 删除普通聊天模式 + Tool Calling 始终开启
fix: ollama.ts - chat() 添加默认 keep_alive: '1h',chatStream done 时不再 reader.cancel()
refactor: 删除普通聊天模式,所有消息统一走 Agent Loop
refactor: Tool Calling 开关始终开启且不可关闭
chore: 版本号 0.10.0 → 0.10.1 (12 处)
docs: 更新帮助面板和 README 反映架构变更
2026-06-06 12:06:48 +08:00
thzxx c9adc764ae feat: v0.10.0 — 全面增强网络搜索、Agent Loop、工具稳定性与性能
网络搜索增强:
- web_search: 4引擎并行(Bing+百度+DuckDuckGo+Google), LRU缓存5min, URL可达性预检, 结构化JSON输出
- web_fetch: 自动重试(指数退避2次), 移动端UA切换, SPA页面自动升级浏览器渲染

Agent Loop增强:
- 流式调用超时保护(默认180s可配置)
- Final Answer多模式检测 + 内容长度验证
- 预算警告改用ephemeral标记(context优先丢弃)
- Token感知动态迭代预算(>80%自动缩减到3轮)
- 工具缓存TTL(搜索5min/网页10min/文件30min)
- 自动子任务拆解(并行关键词检测+spawn子代理)
- 增量记忆提取(每20轮触发)
- 智能批次划分: 16个只读工具加入ALWAYS_PARALLEL白名单
- 旧工具结果超过10轮自动截断到500字符

工具增强:
- read_multiple_files: 串行→并行Promise.all
- diff_files: 三级回退(diff -u → git diff → builtin)
- search_files: 新增use_regex正则搜索
- list_directory: 新增offset分页
- Git: stash参数修复, clone/push/pull超时保护
- browser: 提取ensureBrowserReady()消除重复, browser_open切换URL自动重建

文档更新:
- 帮助面板新增Agent Loop v0.10.0增强章节
- README中英文同步更新(四引擎搜索/工具描述)
- SOUL.md/AGENT.md更新(v0.10.0能力描述/SPA规则翻转)
2026-06-05 21:20:03 +08:00
thzxx 2217113014 feat: v0.9.1 — 图片压缩、文件token预算截断、并行上传、文档同步
- 图片上传: Canvas前端压缩(1280px等比缩放+JPEG), 300KB以下跳过
- 文件上传: Token预算感知截断(30% numCtx), 26种语言注释剥离
- 性能: handleImagePaths/handleTextFilePaths 并行化(Promise.all)
- sub-agent.ts: 修复3个TS编译错误(tool_name类型, success重复)
- 版本号: 全项目统一至0.9.1(10处)
- 文档: BUILD.md/DEVELOPMENT.md 同步实际架构, 移除过期分支引用
- README: 组件列表修正(log-panel.ts→prompt-modal.ts)
- 帮助面板: 更新图片/文件上传描述
2026-06-05 11:32:40 +08:00
thzxx 7b9ac8ac13 spawn_task 模型校验:指定不存在的模型自动回退
- tool description 提示 AI 优先用小模型,不指定则用设置默认值
- 运行时校验:列出已安装模型,指定模型不存在则 warn + 回退
- 导入 state/KEYS 替代 window 全局变量
2026-06-05 10:58:45 +08:00
thzxx f4a92fc40f 设置面板新增子代理默认模型选择器
- 向量记忆引擎下方新增「子代理默认模型」下拉框
- 留空则跟随当前模型,选择后所有 spawn_task 默认使用该模型
- spawn_task 工具仍支持单次指定 model 参数覆盖默认值
2026-06-05 10:56:08 +08:00
thzxx da71020003 spawn_task 支持指定子代理模型
- 工具定义新增 model 参数,可指定小模型跑简单任务
- learn_task 子代理说明更新:展示只读工具能力
2026-06-05 10:52:47 +08:00
thzxx 2d03c5f348 子代理增强:支持只读工具调用 + 可配置参数 + 10轮/5分钟
- 15 个只读工具可用:文件读取、搜索、浏览器查看、记忆/会话/技能查询
- 内置 mini Agent Loop,独立执行工具调用链
- 可配置 maxLoops / timeout / model
- agent-engine 批次并行已天然支持多个 spawn_task 并行
2026-06-05 10:50:14 +08:00
thzxx 361e58b8d1 调整提示词顺序:USER.md 移至 AGENT.md 之后、记忆/工作空间之前 2026-06-05 10:10:17 +08:00
thzxx 9a101b8a44 chatStream 默认 keep_alive=1h,防止模型在 Agent Loop 多轮调用后被 Ollama 服务端卸载 2026-06-05 10:04:02 +08:00
thzxx 34aa16fa3e 修复 README 特性表格行号污染 2026-06-05 09:41:16 +08:00
thzxx ac5e3e1efc 更新帮助面板和 README:新工作空间文件文档,v1.1.0 → v0.9.0
- 帮助面板 SOUL.md 改为 SOUL.md/AGENT.md/USER.md 三个自定义文件
- 去掉技能自动生成 (v1.1) 版本标注
- README 版本号、特性表、架构图、快速开始同步更新
2026-06-05 09:39:17 +08:00
thzxx 988efd1733 v0.9.0: SOUL.md/AGENT.md/USER.md 化为工作空间文件,去掉代码内硬编码提示词
- 版本号 v1.1.0 → v0.9.0
- AGENT_SYSTEM_PROMPT + TOOL_USAGE_GUIDE 提取为 AGENT.md(工作空间优先,内置 fallback)
- SOUL.md 同级改造(工作空间优先,内置 fallback)
- 删除 inferUserProfile 自动用户画像,改为 USER.md 手动编辑
- 三个 .md 内置版本放在 src/renderer/public/(Vite publicDir 自动复制)
2026-06-05 09:35:39 +08:00
thzxx 968350861d fix: 系统提示词卡片包含 SOUL.md 内容
state.set('_lastSystemPrompt') 改为从 messages 中拼接所有 system 消息,
确保 SOUL.md 也出现在 AI 回复顶部的折叠卡片中。
2026-06-04 22:04:54 +08:00
thzxx 846fa0f111 docs: 更新 README v1.1 特性 + 帮助面板实际内容
- README: 新增 SOUL.md/技能v1.1/上下文自动检测/系统提示词卡片特性
- README: 架构图加入 SOUL.md 不可压缩层 + 技能匹配层
- helpModal: 新增 SOUL.md 自定义人格、技能v1.1、Token实时监控说明
- helpModal: 更新聊天功能、上下文长度自动检测描述
2026-06-04 21:51:51 +08:00
thzxx db6cb8d2cc feat: v1.1.0 — 上下文引擎重构 + 技能系统升级 + SOUL.md 支持
- 版本号更新: 1.0.0 → 1.1.0,全量同步 package.json/lock/README/docs/UI
- 上下文长度自动检测: 切换模型时从 model_info 读取实际 context_length
- SOUL.md 支持: 每次发送自动扫描工作空间 SOUL.md,注入为首条 system 消息且不可压缩
- 系统提示词卡片: AI 回复顶部可折叠展示实际发送给模型的完整 system prompt
- Token 校准: 利用 Ollama 返回的实际计数动态修正估算器(EMA)
- 消息重要性评分: 纯规则打分,trim/summarize 按重要性而非时间顺序
- 结构化压缩: LLM 压缩输出 JSON 格式(topics/decisions/pendingTasks/constraints)
- 技能系统 v1.1: 语义匹配(embedding) + 参数自优化 + 未使用衰减 + 技能链合并
- 修复: 100+ TypeScript strict 模式编译错误清零
2026-06-04 21:47:18 +08:00
thzxx b12837433b fix: 版本号改为合法 semver 1.0.0,修复 electron-builder 校验 2026-04-28 15:02:34 +08:00
thzxx 4a7b84c9a2 fix: 调整搜索结果来源引导,优先官方文档而非知乎 2026-04-28 14:46:43 +08:00
OpenClaw Agent 4781abadf0 optimize: enhance web_search, web_fetch, browser tools
- browser.ts: Fix XSS injection in browserClick/browserType via JSON.stringify
- browser.ts: Replace fixed 1000ms wait with did-finish-load event + 30s timeout
- web_fetch: Add 15s HTTP timeout via AbortController
- web_fetch: Improve HTML→text conversion (block-level tags→newlines, nav/header/footer removal, comprehensive HTML entity decoding)
- web_fetch: Add content-length pre-check (10MB limit)
- web_search: Add 15s HTTP timeout per engine request
- web_search: Add URL deduplication across results
- web_search: Clean residual HTML tags/entities from snippets
- download_file: Add 60s download timeout
- tool-registry: Fix missing logWarn import
- Extract shared decodeHTMLEntities with 40+ entity mappings
2026-04-28 11:30:55 +08:00
OpenClaw Agent 45b8b6c330 docs: 更新帮助面板和README,修复过时功能描述
- 帮助面板:修正工具分类(文件系统 12→16,系统&网络→命令执行+联网搜索),分类数 6→8
- README:移除不存在的 cron-manager(定时任务)功能描述(中英文)
- 所有变更基于实际代码分析,38 个工具注册与 tool-registry.ts 一致
2026-04-28 11:07:27 +08:00
thzxx a742d3a5a5 docs: rewrite README with bilingual CN/EN, icons, and verified features 2026-04-25 09:23:33 +08:00
thzxx 200fc51e01 docs: remove references to deleted analysis docs 2026-04-25 08:47:37 +08:00
thzxx 14ba190864 docs: remove OpenClaw/Hermes analysis docs 2026-04-25 08:47:27 +08:00
thzxx 75549ebfa7 docs: 添加推荐规则记忆(面向用户使用) 2026-04-25 08:44:30 +08:00
thzxx f3f81b135d Reapply "docs: 添加推荐记忆规则到 README"
This reverts commit 5e5145cb17.
2026-04-24 15:42:05 +08:00
thzxx 5e5145cb17 Revert "docs: 添加推荐记忆规则到 README"
This reverts commit cf40b8674d.
2026-04-24 15:41:03 +08:00
thzxx cf40b8674d docs: 添加推荐记忆规则到 README 2026-04-24 15:39:25 +08:00
thzxx 2118ad727f refactor: use typed window.metonaDesktop in chat-db.ts
Replaced remaining '(window as any).metonaDesktop' with properly typed
'window.metonaDesktop' in chat-db.ts for consistency with the rest of
the codebase.
2026-04-24 14:04:31 +08:00
thzxx 9cb6c243a7 refactor: use typed window.metonaDesktop instead of (window as any)
Replaced all '(window as any).metonaDesktop' with the properly typed
'window.metonaDesktop' across mcp-client.ts, skill-manager.ts,
agent-engine.ts, and log-service.ts. The MetonaDesktopAPI type is
already declared in types.d.ts, so the 'as any' cast was unnecessary
and bypassed type checking.
2026-04-24 14:03:34 +08:00
thzxx 0065ded925 fix: replace 'any' type with ChatDB for state.get(KEYS.DB)
The DB state variable in agent-engine.ts was typed as 'any', bypassing
type checking for getSetting() calls. Replaced with proper ChatDB type
import and null-safe typing.
2026-04-24 14:02:56 +08:00
thzxx dbeba20286 fix(security): add path validation to git tool handler
handleGit was missing checkPathAllowed validation on the working
directory (cwd), allowing git operations to execute in any directory
bypassing the security policy. Added validation for:
- The cwd used by all git operations
- The clone destination directory (write permission check)
2026-04-24 13:58:19 +08:00
thzxx 15b4895351 fix: replace 'as any' with proper type assertion for git tool args
The git tool handler in ipc.ts was using 'args as any' to bypass type
checking. Replaced with the explicit typed params interface matching
handleGit's signature to maintain type safety.
2026-04-24 13:56:30 +08:00
thzxx e4dc7f945f fix: correct search_files result field name in formatToolResultForModel
The search_files tool handler returns results in a 'results' field
(containing per-file match arrays), but formatToolResultForModel was
referencing 'result.matches' which is undefined. This caused the model
to never see actual search file results, breaking the search → read
tool chain workflow.
2026-04-24 13:55:53 +08:00
thzxx 74f5e384b5 fix: import missing logSuccess in agent-engine.ts
logSuccess was used on line 509 for auto-compress completion logging
but was never imported from log-service.ts, causing a runtime
ReferenceError when context auto-compression triggers.
2026-04-24 13:55:33 +08:00
thzxx fdbdc4007c fix: 修复 Token 仪表盘 — 添加缺失的 renderGlobalChart + 修复概览卡片布局
- 添加 renderGlobalChart 函数(按会话渲染全局柱状图)
- 移除 td-stat-row 嵌套 div,卡片直接放入 tdOverview grid
- 修复全局统计持续报错 renderGlobalChart is not defined
- 修复 5 个统计卡片挤在 1/4 宽度的布局问题
2026-04-24 13:50:02 +08:00
Metona Dev 30452f1fef chore: 恢复 package.json 版本号为 v1-stable-release 2026-04-24 13:17:25 +08:00
Metona Dev b24370cc15 fix: 重写 Token 消耗趋势图 — 网格线 + 正确高度计算 + 柱子底部对齐 2026-04-24 12:56:45 +08:00
Metona Dev 5fafaa691f feat: Token 仪表盘支持全局统计,跨会话累计 Token 分析 2026-04-24 12:53:50 +08:00
Metona Dev 08193c5d8e fix: DBAPI 类型补全 skill 相关方法签名
DBAPI 接口缺少 saveSkill/getAllSkills/deleteSkill/clearAllSkills/
searchSkills/incrementSkillUsage 六个方法的类型定义,
导致通过 bridge.db 调用技能相关方法时缺乏类型安全。
2026-04-24 12:46:52 +08:00
Metona Dev 15ad2f3ef3 fix: skills 表增加 summary 列,修复渐进式技能加载数据丢失
Skill 接口包含 summary 字段且 extractSkillsFromToolRecords() 会生成摘要,
但 SQLite schema 和 saveSkill() 遗漏了该列,导致保存时 summary 丢失。
- CREATE TABLE 增加 summary TEXT DEFAULT ''
- 兼容迁移:ALTER TABLE 补充 summary 列
- saveSkill() INSERT 语句增加 summary 参数
- SkillRow 接口增加 summary 字段
2026-04-24 12:44:23 +08:00
Metona Dev 9f38d35b1e fix: 修复 agent-engine 中 abortController 在自动压缩前未定义导致 ReferenceError 的严重 bug
compressWithLLM() 调用时引用的 abortController 变量在 while 循环内才定义,
但自动压缩逻辑在 while 循环之前执行,导致运行时 ReferenceError。
修复方式:使用 state 中已有的 AbortController 或创建新的实例。
2026-04-24 12:43:30 +08:00
Metona Dev 8e53a411d6 feat: /compress 上下文压缩 + Skill 渐进式加载 2026-04-24 12:35:49 +08:00
Metona Dev fe85251738 docs: README.md 补充工具列表、架构图、记忆系统等详细说明 2026-04-24 12:19:18 +08:00