新增 Hermes Agent 兼容层,建立 plugins/<runtime>/ 规范#279
Conversation
- prettier --write 格式化 knowledge/ 及 README.md - 将 **加粗伪标题** 替换为正确 #### 标题,修复 MD036 - 通过了 prettier --check 和 markdownlint 检查
fix(release): add repository context to GitHub CLI commands in release
loadSharedConfig 的副作用是把 gateway 当前 token 解析并写入 ~/.openclaw/miloco/config.json::agent.auth_bearer。之前误判为无用调用 被删除后,backend 启动读到空 bearer,回调 /miloco/webhook 401, dispatcher 三次重试后 skip batch。 恢复调用并加注释钉死其真正职责,避免再被误删。
…hared-config fix(openclaw): 恢复 register 中 loadSharedConfig 调用
- field_registry: caption/speeches/matched_rules/suggestions 各字段 spec_md 增加约束,未识别(unknown)时不从 gallery/家庭档案取成员名安到画面人物上 - person/router: create_person 与 register_commit 补 home_profile_service.commit() 级联刷新,新增/注册成员后 profile.md 同步家庭成员段 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👋 感谢提交 PR @n0tssss!维护者会尽快 review。 提交前请确认:
|
…try、IM 多 fallback、进度、trap、回滚、保留 target、backup PID+纳秒、pyc、restart banner)
…本/Agent 要点;加老机器 fetch+reset 强制最新 + commit 可见)
…ause + 强制验证推送 + 切 IM)+ adapter 日志全结构化 + install-hermes.sh --diagnose 12 项自检
…aw trace.ts)+ adapter get_trace 真回 meta + gateway_state URL watch 自动 reload
…s/trace_hooks 子项 + UPGRADE.md 5 场景指南(hermes/miloco/plugin/全量重装/切 IM)
This reverts commit 2365621.
老版本 Step 2 一次性把 2.1 / 2.2 / 2.3 全贴出来,用户操作时容易漏步骤, 漏了 agent 也不知道。 改动: - 头部加「引导式流程总览」+ agent 工作纪律(单轮只发一个动作) - 明确「当前该发哪一步」的判定算法(按装完/绑完/配完/重启完 4 状态机) - 每发一个子步骤(2.1 / 2.2 / 2.3)必须停下来等用户回 - 用户回复后 agent 跑验证命令(account status / config get / lsof 8642) 确认通过才发下一个;失败贴 stderr + 翻故障表,不替用户瞎猜 - 用户说「跳过/不知道」→ 仍发下一个子步骤,但提醒上一步未做 - 用户说「算了不装」→ 立即停止,给卸载方法 - 故障排除表加 2 条:2.1 绑完仍 is_bound:false(base64 5 分钟过期)、 2.2 配完仍 null(特殊字符 escape) - 「不要做」追加:不要一次性贴 Step 2 全部子步骤 - 去掉 frontmatter 的 version / date 字段(不需要版本号),改成 last_updated Step 1 顺序、Step 3 验证、状态报告模板不变。
CI Docs 已转绿 ✓之前 force-push 那条 comment 误判 CI Docs 失败原因——以为是 prettier baseline 问题。真实原因是 markdownlint MD036: 现在 CI 状态:13/14 pass,1 skip(pr-review 无人触发),1 pending(CLA 待签)。Docs check ✓。 prettier 从一开始就在 Linux CI 上 PASS,之前 Git Bash 误报 baseline 24 个文件不合规是 autocrlf=true 下的索引假象,maintainer 不需要 fmt baseline。 关于 commits by
|
miloco-cli 没有 --version 标志,只有 version 子命令。原先三处都调 错: - install-hermes.sh:172 (step 3 探测) - install-hermes.sh:712 (step 9 写 state.json) - tools_status.py:189 (自检读当前版本) 导致: - state.json 写进的是 'Usage: miloco-cli [OPTIONS] COMMAND...' 截断串 - 自检永远拿到 'err:2',版本号比对永远 fail 统一改成 'miloco-cli version' + JSON 解析拿 'version' 字段。
又修一个真 bug:
|
|
@CLAassistant recheck |
原先 create_job 和 update_job 都把 deliver 设为 'none',导致感知摘 要 / 家庭巡检 / 家庭做梦 / 习惯建议 这 4 个受管 job 跑成功也 推送不出去(last_delivery_error: no delivery target resolved for deliver=none)。 - create_job 分支:deliver 改 'all'(首次创建默认推所有渠道) - update_job 分支:把 deliver 也加入更新字段(已有 job 重跑 install 也会被同步成 'all',不会被卡在 'none') 用户单推需求用 cronjob update 单独覆盖。 同时手动把当前 4 个受管 cron 的 deliver 改成 'all' 立即生效。
|
@CLAassistant recheck |
又一个 bug fix:受管 cron job 默认 deliver 改 'all'hermes-bot 在 Mac 跑 修法(commit
用户想单推用
PR body 不需要改—— |
对比上游 Xiaomi/xiaomi-miloco install-guide.md 发现两个差异, 都是导致'装完看似 OK 但智能触发全断'的根因。 ## 1. install-hermes.sh 加 Step 4.7:同步 ONNX 模型 上游 install.sh --agent-finish 自动从 upstream release 下 ~80MB 的感知 ONNX 模型(det_4C.onnx / human_body_reid_v2.onnx / bge / silero_vad)到 ~/.openclaw/miloco/models/。 Hermes fork 走的是'plugin 在 fork 仓库内'路线,复用不了上游下载 逻辑——但 fork 仓库的 backend/miloco/src/miloco/perception/models/ 目录里其实打包了同一份模型。 新 step 4.7 自动从 fork 仓库 cp 到 MILOCO_HOME/models/ 并写 config.json::models 字段。已存在的文件不覆盖(幂等)。 漏掉这一步 → 感知引擎 models_missing → perceive query 1000 → 智能触发链路全断但 /health 还显示 ok。 ## 2. install-guide-hermes.md:5 步验证 → 7 步 新加的步骤: - XiaoMi#6 验 ONNX 模型齐不齐(5 个文件) - XiaoMi#6.5 验 config.json::models 字段已写 - XiaoMi#7 真调一次 miloco-cli perceive query(能直接暴露 Omni 模型不支持 video_url 这类纯文本模型错填的问题) 同时在指南里加 '与上游 OpenClaw 安装的差异' 段,方便 PR reviewer 和用户理解为什么补这两个改动。 ## 触发场景 用户装完后感知引擎起不来、perception-digest 一直空、规则零触发。 本 patch 让 install-hermes.sh 一条龙跑完感知引擎也能工作。
|
@CLAassistant recheck |
又一个 bug fix:感知引擎 ONNX 模型漏同步 + Step 3 验证加严hermes-bot 在 Mac 装完跑感知链路时发现一个隐蔽根因:感知引擎起不来,perception-digest 一直空,规则零触发,但 修法(commit 1. install-hermes.sh 加 Step 4.7:同步本地 ONNX 模型从 fork 仓库
漏掉这一步 → 感知引擎 models_missing → perceive query 永远 1000 报错 → 智能触发链路全断但 /health 还显示 ok。 2. install-guide-hermes.md:5 步验证 → 7 步新增:
外加一段 "与上游 OpenClaw 安装的差异" 表,方便 reviewer 和用户理解为什么补这两个改动。 副作用 / 注意事项
|
upstream main 在 pr-hermes 之后推了 9 个 commit (PR XiaoMi#329 修 ONNX 内存泄漏、 XiaoMi#284 加 G711 解码、XiaoMi#282 settings 校验、Python 3.11 升级、Camera 8 设备支持等)。 本次 merge 同步这些变更到 pr-hermes,保证提 PR 时不冲突。 冲突解决: - knowledge/06-dev-guide/troubleshooting.md: Python 版本要求由 3.10 升到 3.11 (跟随 upstream edf87fc "fix: 后端最低 Python 同步到 3.11") 其他文件 (.github/workflows、backend/pyproject、miot/decoder、settings.py、 camera_extra_info、install scripts、web/README、web/App.tsx) 自动合并, pr-hermes 的 hermes plugin/install 改动与上游正交,无功能冲突。
|
[Review] 🔴 背景:PR 卖点之一是装完 cron 自动推 IM(感知摘要每 15min / 习惯建议每天 10 点等)。 问题:核对
触发链路:cron fire → 改进:deliver 必须传 state.json 里探测出的具体平台名。注意 def reconcile_cron_jobs(ctx) -> Dict[str, Any]:
from .tools_notify import get_deliver_target
target = get_deliver_target(ctx)
if not target:
logger.warning(
"state.json::deliver.target 没配,跳过 cron reconcile —— "
"受管 cron job 不会被创建。先配 IM 平台(hermes config set <platform>.bot_token)"
"再重跑 install-hermes.sh 触发 reconcile。"
)
return {"created": 0, "updated": 0, "removed": 0, "skipped": True,
"reason": "no deliver target"}
# ... create_job(..., deliver=target)同时建议补 contract 测试,import Hermes 模块直接验证 deliver 值不落 LOCAL: # tests/test_cron_deliver_contract.py
from gateway.delivery import DeliveryTarget, Platform
def test_cron_deliver_resolves_to_real_platform():
parsed = DeliveryTarget.parse("feishu") # 或其它配置的目标
assert parsed.platform != Platform.LOCAL |
|
[Review] 🔵 合并建议(6 条)—— 不卡 merge 但建议跟进 1.
|
miloco 2.0 默认只接 OpenClaw。这次加了 Hermes Agent(NousResearch 开源 MIT Python agent)作为第二个能选的 agent runtime,让不装 OpenClaw 的用户也能直接用 miloco。
动机
Hermes 自身内置
hermes claw migrate,作者也认它能当 OpenClaw 的替代品。Hermes 是 Python(OpenClaw 是 TS),生态重叠度低,给 Hermes 用户提供 miloco 接入能扩 miloco 用户群。加完顺手建了
plugins/<runtime>/目录规范(见 plugins/README.md),后面要加 LangChain / CrewAI / AutoGen 等第三个、第四个 runtime 就有章可循。架构(OpenClaw → Hermes 怎么映射)
miloco-*skill~/.hermes/skills/(agentskills 标准)openclaw.requires字段before_prompt_buildhookpre_llm_callplugin hookhooks/prompt.ts+services/catalog.ts/miloco/webhook同步等 turn/api/sessions/{id}/chatget_trace后端轮询ctx.register_tool(...)tools/notify.tscron.jobs.create_job+ reconcilehome-profile/scheduler.ts两个关键差异:
用户能看到的功能
装完后用户从 Hermes chat 直接用:
把客厅灯打开/关闭主卧空调—— 调miloco-devicesskillpre_llm_callcontextmiloco-devicesskillmiloco-perception-digestskill 拉感知数据 + 推送 IM(依赖 ONNX 模型 + 感知引擎)miloco-home-patrolskill 检查设备异常 + 推送 IMmiloco-home-observe/miloco-home-promote/miloco-home-prune自动整理家庭记忆miloco-habit-suggestskill 总结主人习惯 + 推送 IMmiloco-miot-identity-registerskill 走录脸/录身形注册家庭成员hermes -z "miloco_status"跑 9 项自检(backend / adapter / state.json / cron / versions / trace)hermes -z "miloco_test_push"验证 IM 通道通miloco_im_pushtool 推到用户 IM(飞书 / 微信 / Telegram / Discord 等)主动推送怎么测(端到端)
装完验证 IM 链路通:
应在你的 IM(飞书/微信/Telegram 等)里收到一条
miloco test push @ <时间戳>。如果没收到:装完等 15 分钟看 IM,感知摘要消息会自动到(前提是 ONNX 模型同步成功,见下面"感知引擎 ONNX 模型"段)。
感知引擎 ONNX 模型同步(隐蔽根因)
上游
Xiaomi/xiaomi-miloco的install.sh --agent-finish自动从 release 下载 ~80MB 的感知 ONNX 模型(det_4C / human_body_reid_v2 / bge / silero_vad)到~/.openclaw/miloco/models/。Hermes fork 走"plugin 在 fork 仓库内"路线,复用不了上游下载逻辑——但 fork 仓库的backend/miloco/src/miloco/perception/models/目录里打包了同一份模型。修法:
install-hermes.shStep 4.7 自动从 fork 仓库 cp 到~/.openclaw/miloco/models/,并写config.json::models字段。已存在的文件不覆盖(幂等)。漏掉这一步 → 感知引擎 models_missing → perceive query 永远 1000 报错 → 智能触发链路全断但 /health 还显示 ok,用户毫无感知。
干了什么
plugins/hermes/:Hermes 插件(5 tool + pre_llm_call hook + 4 cron)+ 入站 adapter(独立 aiohttp 进程,含 macOS launchd LaunchAgent 保活)+ install-hermes.sh 一键脚本scripts/install-guide-hermes.md:playbook 风格,3 步速装 + 引导式 Step 2(agent 单轮只发一个子步骤 + 等用户回 + 验证 + 再发下一个)+ Step 4.7 同步 ONNX 模型 + 7 步验证(含感知引擎真调一次)plugins/README.md:plugins/<runtime>/命名规范knowledge/03-features/hermes-integration.md、knowledge/05-external-deps/sdk-hermes.mdREADME.md/README.zh.md:定位句、What's New、Quick Start、方式一加 Hermes 子段、项目结构、致谢plugins/hermes/miloco-plugin/tools_notify.py:ctx.dispatch_tool("send_message")→subprocess.run(["hermes", "send", ...])(Hermes 把 send_message 从 agent tools 移除)plugins/hermes/scripts/detect_im_platforms.py+write_state_json.py:IM 探测 + state.json 写盘外部化(避开 macOS bash 3.2 heredoc 嵌套括号挂)plugins/hermes/UPGRADE.md:5 场景升级指南怎么测
实测结果:
miloco -z "miloco_status"9 项自检全 ✓miloco_test_push真发 IM 消息验证打通miloco-cli perceive query真调一次验证感知引擎链路通(Step 3.1 chore: update chore logic #7)对现有用户的影响
零。OpenClaw 是默认路径,Hermes 是新增选项。后端代码、OpenClaw 插件、共享 skill 源一个字节没动。
CI
13/14 通过,1 skip(pr-review 无人触发)。后端测试 / cli / lint / plugin / docs 全绿。Docs check 之前挂是 markdownlint MD036(
hermes-integration.md用**Bold**当 heading)—— 这次修完转绿了。PR 模板确认