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
thzxx
4d03c35ea9
fix: 工作空间面板底栏与消息输入区底栏对齐
...
.workspace-panel 显式设置 height:100vh,与 .main-wrap 一致,
确保两者 flex 子元素等高,底栏(ws-term-toolbar 与 input-area)
自然对齐。
2026-04-23 11:55:21 +08:00
thzxx
4caa230c47
fix: 会话消息中工具卡片始终显示 ✅ 0 ❌ 0且永远转圈执行中
...
根因:onNewIteration 保存工具记录时 status='running'、result=null,
工具执行完成后只更新了工作空间面板,未更新消息中的记录。
修复:
1. 新增 updateMessageToolRecord() 函数,从后往前查找消息中
running 状态的同名工具记录并更新为最终状态
2. onToolCallResult/onToolCallError 回调中同步更新消息记录
3. onDone 多迭代模式下,最终消息也包含 toolRecords
2026-04-23 11:52:53 +08:00
thzxx
f46edc308a
fix: 工具页签底栏统计文字颜色不可见(白底白字)
...
.ws-tools-hint 从 rgba(245,240,232,0.4) 改为 var(--text-tertiary),
与终端页签底栏 .ws-term-hint 保持一致。
2026-04-23 11:51:03 +08:00
thzxx
72565b3220
fix: 彻底修复 TDZ 错误和用户消息不显示问题
...
1. agent-engine.ts: onNewIteration 改用 prevToolCalls 传递上一轮工具调用,
避免引用未声明的 toolCalls 导致 TDZ (Cannot access 'B' before initialization)
2. chat-area.ts: 新增 resetCurrentPlaceholder() 清理悬空 DOM 引用
3. input-area.ts: 错误处理器删除 placeholder 后清理 currentPlaceholder 引用,
防止后续 updateLastAssistantMessage 操作已脱离 DOM 的旧节点
2026-04-22 09:40:38 +08:00
thzxx
9915b71da1
fix: Agent Loop 多轮迭代消息保存和 token 统计
...
- 修复 onDone 多轮迭代时更新旧消息而非创建新消息,导致 post-tool 回复丢失
- 修复 pre-tool 消息的 toolCalls 未保存(onNewIteration 未传递 toolCalls)
- 修复最后两条 AI 消息无 token 显示(统计附着到被覆盖的消息上)
- onNewIteration 回调增加 toolCalls 参数,保存消息时附带工具调用记录
- handleRetry 同步修复
2026-04-21 14:08:07 +08:00
thzxx
dc3d6e4b69
fix: 修复第二条消息不显示和上传文件AI读取失败
...
Bug 1: renderMessages() 统计 .message 元素时把 loading placeholder 也计入,
导致第二条用户消息被跳过不渲染。改为 .message:not(.loading) 排除加载占位符。
Bug 2: Agent Loop system prompt 缺少文件内容感知规则,用户上传文件后让AI读取,
AI 调用 read_file 去工作空间找文件导致失败。在 TOOL_USAGE_GUIDE 新增规则 16,
明确告知模型上传文件内容已在对话消息中,无需调用 read_file 工具。
2026-04-21 11:29:33 +08:00
thzxx
e5acf646c8
fix: 修复多迭代 Agent Loop 的两个UI bug
...
Bug 1: 正在思考占位符作为独立消息残留
- 根因: renderMessages() 将 loading placeholder 计入 existingCount,
导致新保存的消息不被渲染,旧 placeholder 永远留在页面上
- 修复: onNewIteration 保存消息前先移除旧 placeholder
Bug 2: 只有最后一条AI消息显示 token 统计
- 根因: onNewIteration 保存中间消息时不附带 token/duration 统计,
只有 onDone 对最后一条才添加 loopStats(总累计值)
- 修复: 追踪每轮迭代的 eval_count 增量和耗时,
中间消息和最后消息均保存 per-iteration 统计,
确保 updateTotalTokens 求和不重复计数
2026-04-21 09:05:07 +08:00
thzxx
2496e04685
fix: 修复用户消息不显示和思考气泡残留
...
renderMessages() 中 existingCount 使用 children.length 计算,
包含了 currentPlaceholder(正在思考...)元素,导致:
1. 新用户消息被误判为已渲染而跳过
2. 旧 placeholder 残留 DOM 变成独立消息气泡
修复:existingCount 改用 querySelectorAll('.message') 只计算实际消息元素
2026-04-20 21:00:42 +08:00