Commit Graph
363 Commits
Author SHA1 Message Date
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
Metona Dev 390161bc32 fix: 版本号统一为 v1-stable-release(非 1.0.0) 2026-04-24 11:44:30 +08:00
Metona Dev 0acff6b6e3 chore: 版本号重置为 v1-stable-release,删除更新日志,重写 README 2026-04-24 11:42:20 +08:00
Metona Dev 4292e7d54c fix: 补充 memory-manager.ts 中缺失的 logInfo 导入 2026-04-24 11:33:42 +08:00
Metona Dev f7fb47939d refactor: 移除人格模式、后台检查、系统诊断、定时任务功能 2026-04-24 11:29:52 +08:00
thzxx 5cbb71cf50 fix: Token趋势图2秒刷新丢失滚动位置 2026-04-23 17:23:56 +08:00
thzxx 118af9dd9a fix: Token趋势图柱子不显示 — 柱子容器高度塌缩修复 2026-04-23 17:22:41 +08:00
thzxx aa9bfa01f7 fix: Token趋势图数值区分输入/输出颜色 2026-04-23 17:19:53 +08:00
thzxx 4070f85214 fix: 普通聊天流式模式未捕获 prompt_eval_count 导致趋势图无法区分输入/输出 token 2026-04-23 17:04:20 +08:00
thzxx d3c38977bc fix: AI消息时间戳显示、工具调用卡片恢复
1. 修复AI回复消息不显示时间戳的问题:updateLastAssistantMessage 新增 timestamp 参数
2. 恢复工具调用卡片显示(工具名称+参数,不显示执行结果):updateLastAssistantMessage 新增 toolCalls 参数
3. 根因:流式消息通过 updateLastAssistantMessage 更新 DOM,但该函数未渲染时间戳和工具卡片,
   而 renderMessages 因 placeholder 已被计数而跳过 appendMessageDOM
2026-04-23 16:50:06 +08:00
thzxx bbd408f326 fix: 工具卡片错误信息显示、清理死代码
1. 工具调用失败时显示错误原因(之前只有状态标签没有具体错误)
2. 删除 formatFileSize 死代码(仅在已移除的结果渲染中使用)
3. 清理 updateLastAssistantMessage 未使用的 stats 参数
2026-04-23 16:19:53 +08:00
thzxx 21b9a14824 fix: Token统计准确性修复 + 仪表盘增强
1. 修复eval_count只记最后一轮的bug:改为每轮累加
2. 新增prompt_eval_count(输入token)统计
3. 修复total_duration使用Ollama实际推理时间而非墙钟时间
4. 数据库messages表新增prompt_eval_count列(含兼容迁移)
5. 仪表盘显示输入/输出token分项统计
6. 柱状图堆叠显示输入(紫色)+输出(橙色)比例
7. 明细表格新增输入/输出/合计三列
2026-04-23 16:11:17 +08:00
thzxx e96b2a840e feat: 新增Token实时监控仪表盘 2026-04-23 16:00:13 +08:00
thzxx 684b2f773b feat: 工具卡片精简、移除token统计、消息时间显示
1. 聊天消息工具卡片只显示工具名+调用内容,不显示执行结果(工作空间工具页签已有完整结果)
2. 移除所有token统计相关代码:顶栏统计、消息内token/耗时显示、历史记录中的token显示
3. 每条消息显示具体时间(年月日 时分秒),formatTime 已含秒数
2026-04-23 15:42:15 +08:00
thzxx 7ed75415a3 fix: 工具卡片状态更新后即时刷新消息渲染
updateMessageToolRecord 更新 state 后缺少 renderMessages() 调用,
导致消息中的工具卡片状态不会实时更新(始终显示 running)。

添加 renderMessages() 调用,确保工具执行完成后消息中的卡片
立即显示正确状态(/)。
2026-04-23 12:36:32 +08:00