Commit Graph

364 Commits

Author SHA1 Message Date
晴天
b65296a489 feat(portable): 便携模式支持迁移回本机——双向迁移闭环
migrate_to_portable 的反向:便携模式下面板设置新增「迁移回本机」。

- 语义:以 U 盘数据为准,本机已有 OpenClaw / Hermes 数据先整体改名
  备份(.backup-时间戳,rename 即时完成;空目录直接复用不备份),
  再全新复制,避免新旧数据合并出难排查的混合状态
- 覆盖:OpenClaw 数据目录(含模型渠道、创作中心数据)、Hermes 数据
  目录、面板配置(与正向迁移同理清洗指向 U 盘的绝对路径字段)
- 不迁移引擎与运行时(本机按常规方式安装),报告卡片明示备份位置
  与下一步操作;重叠路径防呆;确认弹窗列出影响清单
- Web 模式明确拒绝并提示用桌面端;i18n 简/繁/英

测试:migrate_to_local_impl 备份/复制/清洗/重叠拒绝 2 个单元测试;
cargo test --lib 316 通过,node --test 428 通过,clippy/fmt 干净。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 22:20:26 -07:00
晴天
bfc46841fa fix(ci): promote_nested_standalone_dir 按平台门控消除 Unix 死代码告警
该函数的生产调用点仅在 Windows zip 解压路径(Unix 走 tar),
Linux/macOS 的 clippy -D warnings 报 dead_code 导致 CI 失败。
用 cfg(any(windows, test)) 门控:保留跨平台单元测试覆盖。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 21:04:36 -07:00
晴天
1dc9151b63 feat(hermes): 安装向导体验重做——实时日志、镜像配置、可操作错误与断点续行
依据上游 Hermes 源码(官方 install.sh/ps1 → uv → setup → doctor 流程)
与面板安装链路审计(18 项问题清单,见 .tmp 调研文档)实施:

- 安装输出实时流式:新增 run_install_command_streaming,uv tool/pip
  安装的 stdout/stderr 逐行实时 emit(原 wait_with_output 等进程结束
  才发日志,用户盯 3-10 分钟转圈);stderr 保留尾部 8KB 供失败诊断
- 网络与镜像 UI:安装步新增折叠区,PyPI 镜像(清华/阿里云/自定义)
  与 Git 镜像前缀直接在向导内配置并持久化(panelConfig,后端已读取)
- 失败诊断可操作:诊断关键词覆盖 PyPI 超时/SSL/代理/解析失败,
  给出镜像与代理建议;uv pip 备选安装路径同样接入诊断
- 检测门控:环境有提示项(Python 版本/Git 缺失)时停留检测页等确认,
  不再 800ms 自动跳走;全部正常仍自动进入下一步
- 断点续行:向导阶段写入 sessionStorage,重开回到上次步骤
  (以检测结果为前提校验,complete 不恢复)
- 配置步错误改内联面板,API Key 旁提示「获取模型列表」可验证 Key;
  自定义网关健康检查对 ok=false 响应视为失败

另修复模型渠道页 API 类型下拉显示 [object Object](API_TYPES 为
{value,label} 对象数组),卡片芯片同步显示可读类型名。

验证:npm build / node --test 427 通过 / cargo fmt+clippy -D warnings /
cargo test --lib 314 通过

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 12:07:40 -07:00
晴天
dba69ee0fc feat(channels): 统一模型渠道——一处配置,同步 OpenClaw / Hermes / 晴辰助手
新增「模型渠道」页面(通用分组):用户只维护一份渠道配置
(服务商预设 / Base URL / API Key / 模型列表 / 默认模型),
通过显式同步推送到三个消费方,消灭重复配置。

实现要点:
- 渠道存储 src-tauri/src/commands/model_channels.rs:
  读取只回掩码(apiKeySaved/apiKeyMask),写入支持 __KEEP__ 哨兵保留旧 Key,
  明文 Key 仅经 reveal_model_channel_key 在同步时取出;
  文件位于 openclaw 数据目录下,便携迁移自动带走;含 6 个单元测试
- 同步逻辑 src/lib/model-channels.js 组合现有命令完成(各自带自动备份):
  OpenClaw 只 upsert 对应 provider 保留未知字段;
  Hermes 写 provider 环境变量 + 可选默认模型(仅 OpenAI/Anthropic/Gemini
  兼容 API Key 型,OAuth/SDK 型仍走 Hermes 向导);
  助手为一次性拷贝到 localStorage
- 页面 src/pages/model-channels.js:渠道卡片 + 三目标同步状态徽标
  (已同步/有未同步变更/未同步)+ 编辑弹窗(预设自动填充、在线拉取模型、
  默认模型联动)+ 从 OpenClaw 现有配置一键导入 + 全部操作确认弹窗
- Web 模式 dev-api.js 同构 handler + ALWAYS_LOCAL;i18n 简/繁/英 +
  侧栏 11 语言;tests/model-channels.test.js 锁定注册链与安全约束

验证:npm build / cargo fmt+check+clippy -D warnings / cargo test --lib
314 通过 / node --test 全部 427 通过

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 11:48:24 -07:00
晴天
b04deb4e54 fix(release): 0.18.6 收口——审查修复、创作中心与便携迁移加固、设置页提速
按全量代码审查(8 角度 × 对抗验证)修复 10 项确认问题并完成收口:

安全:
- 媒体资产下载仅对与服务商 Base URL 同主机的地址携带 API Key,防止密钥外泄
- 助手媒体工具默认关闭需显式开启;付费图片/视频生成在任何模式下强制确认

数据与容错:
- 媒体数据统一存放 openclaw 数据目录下,便携迁移后配置与历史直接生效
- 视频轮询 429/5xx 瞬时错误不再永久标记失败;失败任务可重新轮询找回
- 创建视频任务无法识别任务 ID 时保留任务记录与原始响应(可能已计费)
- 便携迁移失败时正确显示错误状态;便携命令加入 Web 模式 ALWAYS_LOCAL

性能与体验:
- 任务记录落盘前裁剪 base64 等超大字段,媒体历史文件不再膨胀
- 资产预览 stat 预检 + 64MB 上限 + 缓存淘汰;轮询并行化(后端 jobs 加锁)
- 初始设置页两阶段渲染:本地检测先出首屏,版本网络查询异步补充
- 创作中心删除改用统一确认弹窗(原生 confirm 在 macOS WebView 失效)
- 检查配置/获取模型列表放行 http:// 自建网关;桌面/Web 状态解析对齐
- 统一三处路径包含检查为 utils 共享 helper(Linux 大小写误判修复)
- 补充便携模式 hermes-cli-missing 警告翻译(简/繁/英)

其他:修复 web-headless-reload-policy 陈旧断言(e16ff2b 后 ws-client 已无隐式 reload)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 11:43:33 -07:00
晴天
0a65ea7c7e fix(security): 收紧路径与 Gateway 清理策略 2026-06-15 16:20:35 +08:00
晴天
cf2572ea99 fix(hermes): 兼容最新版 Web Search 策略 2026-06-15 14:00:07 +08:00
晴天
675ad1628b fix(openclaw): 兼容新版配置与 Node 门槛 2026-06-11 15:24:01 +08:00
晴天
a254ebb605 fix(ci): avoid non-windows unused import 2026-06-08 23:09:48 +08:00
晴天
6298468ad8 fix(ci): satisfy clippy for node upgrade checks 2026-06-08 22:59:50 +08:00
晴天
a4d967a497 chore: release v0.18.2 2026-06-08 22:54:11 +08:00
晴天
d60db3b71b fix(setup): 补齐跨端 Node 检测与新手引导 2026-06-08 22:31:00 +08:00
晴天
634fe66556 fix(setup): 完善 Node 版本检测与升级引导 2026-06-08 22:04:55 +08:00
晴天
e16ff2baee fix(openclaw): stabilize windows install and pairing 2026-06-07 03:28:10 +08:00
晴天
de1531d111 feat: prepare v0.18.0 release 2026-06-06 18:32:37 +08:00
晴天
f340b64028 feat(update): integrate official site update flow 2026-06-06 13:59:52 +08:00
晴天
f2fbd9106d chore: release v0.17.0
See CHANGELOG.md for the full notes. Highlights:

- feat(hermes): 50+ visual config panels covering session runtime, model
  management, terminal/sandbox, kanban, safety/privacy, display, browser,
  voice and toolsets — replaces hand-editing ~/.hermes/config.yaml.
- feat(hermes): maintenance/upgrade controls (Update Backup, Session Store
  Maintenance, Curator Maintenance).
- feat(channels): 14 new channels (iMessage / WhatsApp / Telegram / Discord
  plugin runtime / Signal / Microsoft Teams / LINE / Mattermost / Synology /
  Google Chat / Zalo / DingTalk / Tlon / IRC / Nostr / Twitch / Nextcloud
  Talk / ClickClack), unified channel editor, SecretRef preservation,
  multi-account save, generic diagnostics.
- fix(hermes): critical upstream 0.14.0 missing pieces compensated
  (dashboard_auth stubs + web_dist index.html injected at install/update/
  start; idempotent + self-yielding when upstream ships the real files).
- fix(hermes): upgrade path now installs runtime extras (croniter / httpx /
  openai / aiohttp / websockets) to prevent post-upgrade Gateway crashes.
- fix(hermes): hermes_venv_python now resolves uv-tool install paths so
  '可选依赖管理' / 多 Gateway 看板 stop falsely reporting 'venv not found'.
- fix(hermes): group-chat page no longer renders run_id as the reply text;
  it now listens to hermes-run-done and reads payload.output.
- fix: dashboard race condition (#301), Node.js nvm-managed version
  detection (#295), agent models sync with merged openclaw.json (#297).

Hot-update minAppVersion bumped to 0.17.0 because src-tauri/src/lib.rs
registers 40+ new Tauri commands — older desktop builds must NOT pull this
frontend via hot-update or they will hit missing-command crashes.
2026-05-28 09:42:40 +08:00
晴天
30691c68cb fix(hermes): make hermes_venv_python aware of uv-tool default install path
hermes_venv_python() only looked at \HERMES_PYTHON\ and \~/.hermes-venv\
(the uv-pip layout), but ClawPanel's default \install_hermes\ runs
\uv tool install\ and lands the Python at
\<uv tool dir>/hermes-agent/{Scripts,bin}/python\. Result: any code path
that funnels through \
un_venv_python_json\ — most importantly the
'可选依赖管理 / Optional Dependencies' page (hermes_lazy_deps_*) — refused
to start with 'Hermes venv 未找到(~/.hermes-venv 不存在)。请先安装 Hermes。',
even on machines where Hermes was already installed and Profile / Channels /
Dashboard pages worked fine.

Refactor:
  - Extract \hermes_uv_tool_root()\ (resolves \<uv tool dir>/hermes-agent\).
  - Add \hermes_uv_tool_python()\ (returns Scripts/python.exe on Windows,
    bin/python on Unix).
  - Reuse \hermes_uv_tool_root()\ from the existing
    \locate_hermes_cli_package_dir()\ so the two helpers share one source
    of truth.
  - \hermes_venv_python()\ now falls through to the uv-tool path after
    \HERMES_PYTHON\ and \~/.hermes-venv\. Error message updated to list
    every probed location so users on truly-uninstalled machines still get
    actionable feedback.

Verified end-to-end: the actual installed venv at
\%APPDATA%/uv/tools/hermes-agent/Scripts/python.exe\ runs
\rom tools.lazy_deps import LAZY_DEPS\ cleanly and reports 25 features.
2026-05-28 09:16:58 +08:00
晴天
1836069b0f fix(hermes): self-host dashboard_auth + web_dist stubs to survive upstream missing pieces
Upstream hermes-agent 0.14.0 (both the PyPI wheel and the public git source
at NousResearch/hermes-agent) ships hermes_cli/web_server.py with hard imports
of hermes_cli.dashboard_auth.{audit,middleware,prefix,routes,ws_tickets} but
those source files are not included in the distribution, and the dashboard
SPA bundle (hermes_cli/web_dist/) is also missing. On Windows this makes
'hermes dashboard' crash on startup, which collapses every ClawPanel page
that talks to port 9119 (Profile / Kanban / OAuth / Channels / Sessions
detail) into a 'request rejected by target machine' error.

Per project policy we do not patch upstream. Instead, after each install /
upgrade and again before spawning the dashboard, ClawPanel now injects a
minimal pass-through stub into the installed venv:

  - hermes_cli/dashboard_auth/{__init__,audit,middleware,prefix,routes,
    ws_tickets}.py — no-op providers, safe on loopback (127.0.0.1) where
    the auth gate is intentionally disabled.
  - hermes_cli/web_dist/index.html + assets/ — so mount_spa() takes the
    token-injecting branch instead of the 'Frontend not built' 404 branch.
    Without this the panel can never scrape window.__HERMES_SESSION_TOKEN__
    from the dashboard HTML and every /api/* call fails with 401.

Injection is idempotent: if upstream eventually ships the real files, the
stub writer skips them so the real implementation wins. Failures are
logged-and-swallowed so install/upgrade is never blocked by best-effort
compatibility patches.

Group-chat page is also fixed: hermes_agent_run resolves to the run_id
string (not a result object), so the page was rendering 'run_xxx...' as
the assistant reply. It now listens to hermes-run-{started,delta,done,
error,cancelled} events and resolves to payload.output (with accumulated
delta as fallback).
2026-05-28 08:53:37 +08:00
晴天
863d7d75be fix(hermes): include all runtime extras in upgrade path
update_hermes only passed --with croniter, while install_via_uv_tool
passes --with croniter --with httpx --with openai --with aiohttp --with
websockets. After running "Upgrade Hermes" from the panel, the four
missing deps disappeared from the uv tool venv. "hermes gateway run"
then started successfully (cron-only mode) but the api_server platform
adapter failed to construct because aiohttp was absent, so port 8642
never came up and the panel hung on "starting...".

Extract HERMES_RUNTIME_EXTRA_DEPS as a single source of truth plus
append_hermes_runtime_extras and hermes_runtime_extras_log_segment
helpers, and route both install_via_uv_tool and update_hermes through
them so future dep additions cannot drift between the two paths.
2026-05-28 08:02:28 +08:00
cursor[bot]
99b62ccc04 fix(config): sync agent models from merged openclaw.json after write (#297)
Fixes #127 — sync_providers_to_agent_models now uses cleaned (merged+stripped) config instead of raw frontend payload, preventing partial writes from dropping other providers from agents/*/agent/models.json.
2026-05-28 07:23:01 +08:00
friendfish
c38ca39830 fix: 修复 Node.js 版本检测优先命中系统路径而非 nvm 管理版本的问题 (#295)
Fixes #294 — Move version-manager paths (nvm/fnm) before hardcoded system paths (/usr/local/bin etc.) on macOS and Linux so the user's nvm-managed Node is detected first.

Co-authored-by: friendfish
2026-05-28 07:21:42 +08:00
晴天
ca99e27406 feat(hermes): add display tui controls 2026-05-27 06:59:16 +08:00
晴天
b51bde929e feat(hermes): add browser camofox controls 2026-05-27 06:43:41 +08:00
晴天
3c29431be0 feat(hermes): add terminal docker advanced controls 2026-05-27 06:28:45 +08:00
晴天
63533036cf feat(hermes): add display analytics controls 2026-05-27 06:13:49 +08:00
晴天
88ac3f6cca feat(hermes): add context engine controls 2026-05-27 05:39:22 +08:00
晴天
a592b0194d feat(hermes): add x search controls 2026-05-27 05:25:42 +08:00
晴天
c9e4a380a9 feat(hermes): add model catalog controls 2026-05-27 05:06:32 +08:00
晴天
18c0164bdb feat(hermes): add lsp diagnostic controls 2026-05-27 04:49:03 +08:00
晴天
3bb3c9a7c3 feat(hermes): add web tool backend controls 2026-05-27 04:33:03 +08:00
晴天
0b4a70e7a4 feat(hermes): add terminal cloud runtime controls 2026-05-27 04:17:17 +08:00
晴天
c196cef026 feat(hermes): add tts voice controls 2026-05-27 04:02:36 +08:00
晴天
68320496b3 feat(hermes): add terminal env passthrough controls 2026-05-27 03:39:06 +08:00
晴天
8151092e0e feat(hermes): add terminal shell environment controls 2026-05-27 03:23:27 +08:00
晴天
66a23f861c feat(hermes): add update backup controls 2026-05-27 02:33:57 +08:00
晴天
77ab060e9c feat(hermes): add session store maintenance controls 2026-05-27 02:14:20 +08:00
晴天
d2236afc2d feat(hermes): add curator maintenance controls 2026-05-27 01:59:06 +08:00
晴天
ec0f7ec64a feat(hermes): add skills security controls 2026-05-27 01:40:53 +08:00
晴天
8f7f2a6e8e feat(hermes): add browser advanced controls 2026-05-27 01:27:23 +08:00
晴天
8703dffc5b feat(hermes): add kanban profile routing controls 2026-05-27 01:14:10 +08:00
晴天
ae9d6e8844 feat(hermes): add kanban worker log controls 2026-05-27 00:57:00 +08:00
晴天
1630462ccc feat(hermes): add kanban concurrency controls 2026-05-27 00:40:37 +08:00
晴天
80ed2d0e8c feat(hermes): add kanban dispatcher controls 2026-05-27 00:12:20 +08:00
晴天
425fcd847f feat(hermes): add kanban dispatch config 2026-05-26 23:57:52 +08:00
晴天
842cf83917 feat(hermes): add display tool prefix config 2026-05-26 23:37:38 +08:00
晴天
466e6c8831 feat(hermes): add telegram runtime options 2026-05-26 23:22:25 +08:00
晴天
45aadbdc63 feat(hermes): add docker env forwarding config 2026-05-26 06:52:16 +08:00
晴天
7ca586694b feat(hermes): add terminal ssh config 2026-05-26 06:34:57 +08:00
晴天
c0df3ac10c feat(hermes): add terminal sandbox image config 2026-05-26 06:25:31 +08:00