让 Hermes Studio 的「编程工具」页和「群聊房间」支持 Reasonix 编码代理,体验与 Codex 一致(面板卡片 + 群聊多轮对话)。
Hermes Studio(hermes-web-ui npm 包)的 Coding Agents 面板和群聊房间原生只支持两种编码代理:claude-code 和 codex。前端列表、后端白名单、群聊下拉框均为硬编码,不扫描已安装工具。
本项目通过字符串精确替换方式,为 Hermes 的编译产物打补丁,将 reasonix 接入为第三类 coding agent。补丁分两部分:
- 后端补丁(
patches/apply_patch.py):dist/server/index.js,接入白名单、reasonix 方法、群聊/工作流 - 前端补丁(
patches/apply_frontend_patch.py):浏览器 bundle,群聊列表开虚拟滚动,解决大消息量房间卡死
- ✅ 编程工具页:出现「Reasonix」卡片,可安装/启动(含 scoped「提供商和大模型」模式)
- ✅ 群聊房间:可添加 Reasonix agent,实现多轮对话、工具调用过程、思维链展示
- ✅ 工作流:可添加 Reasonix 节点并运行
- ✅ 群聊卡死修复:大消息量房间(如 177k tokens)开虚拟滚动,不再一次性渲染全部 DOM
- ✅ 群聊稳定性修复:服务端事务嵌套导致进程崩溃 / 502 Bad Gateway(SAVEPOINT 方案,已压测验证)
- ✅ 群聊头像修复:reasonix 在群聊显示定制头像(0.6.39 升级后复发,二次修复并持久化)
- ✅ 编程工具页 reasonix 恢复:升级后 CodingAgentsView 独立文件被覆盖、reasonix 卡片消失;补 8 处配置 + cache-bust + 一键脚本改为后端前端一起打(commit 9b8c633)
- ✅ agent 单轮工作量调优:maxSteps 90->150,减少多步骤任务被中途截断(运行时配置,重启生效)
- ✅ 群聊/工作流下拉 reasonix 恢复:升级后新建群聊房间 agent 下拉、工作流 agent 节点下拉无 reasonix;补 GroupChatView + WorkflowView 各 2 处 + cache-bust(commit 待提交)
- ✅ 补丁脚本:Hermes 升级后一键重打,精确匹配、失败即报错
| 项 | 值 |
|---|---|
| Hermes Studio | hermes-web-ui@0.6.39(npm 全局安装,已验证版本) |
| Reasonix | reasonix@1.21.0(npm) |
| 模型 key | DEEPSEEK_API_KEY / HERMES_REASONIX_KEY(存于 ~/.reasonix/.env) |
# 1. 查看当前状态(后端 + 前端)
bash apply-patch.sh check
python3 patches/apply_frontend_patch.py check
# 2. 应用补丁
bash apply-patch.sh apply
python3 patches/apply_frontend_patch.py apply
# 3. 验证补丁完整性
bash apply-patch.sh verify
python3 patches/apply_frontend_patch.py verify
# 4. 重启服务
systemctl restart hermes-web-uinpm install -g hermes-web-ui
bash apply-patch.sh apply
python3 patches/apply_frontend_patch.py apply
systemctl restart hermes-web-ui补丁脚本基于精确字符串匹配。若升级后 Hermes 结构变化,脚本会检测到并报错(不静默改坏),需核对后更新
patches/rules.json(后端)与patches/apply_frontend_patch.py(前端)。
reasonix-x/
├── README.md # 本文件
├── apply-patch.sh # 一键重打后端补丁(shell 包装)
├── docs/
│ ├── DEVELOPMENT.md # 设计方案(架构/协议/补丁机制)
│ └── PROGRESS.md # 项目进度(回滚基线/踩坑教训)
├── index.js.bak # 上游原始基线(补丁锚点)
├── index.js.bak2 # 历史基线:主接入
├── index.js.bak3 # 历史基线:去重+工具+思维链
├── index.js.bak4 / bak8 # 历史基线:完整生产
├── index.js.test.js / test2.js # 生产快照(scoped CLI 修复版)
├── patches/
│ ├── rules.json # 后端替换规则(replace/insert/EH/methods)
│ ├── apply_patch.py # 后端补丁引擎(check/apply/verify)
│ ├── apply_frontend_patch.py # 前端补丁引擎(群聊虚拟滚动 + reasonix 头像映射 + 编程工具页 reasonix 卡片)
│ └── reasonix.png # reasonix 群聊头像图片资源
└── reasonix.toml # provider 映射模板
- 真实 API key 从不入库,存于
~/.reasonix/.env(由.gitignore排除) - Git 身份使用 noreply 邮箱,不泄露真实邮箱
- 补丁脚本只改编译产物,不触碰源码
- DEVELOPMENT.md — 架构理解、Reasonix 协议、补丁机制
- PROGRESS.md — 进度总览、回滚基线、踩坑教训
MIT — 版权 © 2026 ddonggit
Reasonix 接入 Hermes Studio 补丁工程 · 独立全栈自维护