Skip to content

Commit 40335a4

Browse files
committed
feat(aletheia): "派 Hermes" 默认走 orchestra auto + Hermes 真接通了
agent 已在 VPS 配通 Hermes (gateway+DeepSeek+default profile), 测试 task 端到端 8 秒回中文回复. 我把 OntologyNode "派 Hermes" 按钮的链路切到真模式: useCanvasStore.promoteOntologyToTask: - TaskNode data 默认填 agentMode='auto', assignedTo='hermes', hermesAssignee='default' - 不再调 dispatchTaskNode (manual hermes-proxy 流), 让 orchestra dispatcher 自动接管 - VPS conductor (mock 模式) 已切真模式 (systemd 加 HERMES_USER/PASS/DEFAULT_ASSIGNEE) - 链路: 浏览器点"派 Hermes" → conductor 抢锁 → POST Hermes Kanban (assignee=default) → Hermes worker 接 → DeepSeek 真返回 → 写 ResultNode 回 Y.Doc → 三人浏览器看到 HERMES-BOOTSTRAP-FOR-LICHANG.md 头部撤回我之前"⛔ 不要启 gateway"的判断: - 实测 hermes gateway 内嵌 kanban dispatcher (kanban.dispatch_in_gateway=true) - 必须启 gateway 才能让 ready task 被 worker 接走 - agent 已替 lichang 完成所有配置, 只剩 SOUL.md 加 kanban_done 工具调用提示 [ui-cc] 2026-05-02
1 parent 5be60fc commit 40335a4

2 files changed

Lines changed: 46 additions & 16 deletions

File tree

docs/HERMES-BOOTSTRAP-FOR-LICHANG.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,51 @@
77
88
---
99

10-
## ⛔ 千万不要做的事 (重要!)
10+
## ⚠️ 撤回前一版"不要启 gateway"的判断 (2026-05-02 23:50 更正)
1111

12-
**不要执行 `hermes gateway start/restart/install`**.
12+
我之前在这里写了"⛔ 不要做 hermes gateway"——**错了**, 撤回. 实测发现:
1313

14-
`hermes gateway`**messaging gateway** (Telegram / Discord / WhatsApp), **不是 LLM gateway**.
15-
know-canvas 的 auto 派单 / Aletheia 拆解 / Hermes worker 跑 task **完全不依赖它**.
14+
- `hermes gateway` 名字虽叫 messaging gateway, **但默认内嵌 kanban dispatcher** (`kanban.dispatch_in_gateway=true`)
15+
- **没启 gateway → dispatcher 不跑 → ready task 永远不被 worker 接走**
16+
- 所以 **gateway 必须启**
1617

17-
如果你看到这个错误:
18+
## ✅ 已经全部配好了 (2026-05-02 23:50, agent 替你做了)
1819

20+
诊断 + 修复 agent 已完成下面所有事, 你不用再操作:
21+
22+
1.`loginctl enable-linger root` (开 user systemd 持久化)
23+
2.`hermes gateway install && hermes gateway start` (PID 13823, 现运行)
24+
3.`/root/.hermes/.env` 加了 `DEEPSEEK_API_KEY=sk-...` (boss 提供的 key)
25+
4.`/root/.hermes/config.yaml` 改 model.default=`deepseek-chat`, provider=`deepseek`, base_url=`api.deepseek.com/v1`
26+
5.`systemctl restart hermes-dashboard` 已重启
27+
6. ✅ 测试 task `t_50064147` 端到端跑通: DeepSeek 8 秒返回中文回复
28+
29+
## 验证当前状态
30+
31+
```bash
32+
curl -s -u "hermes:bdegDr5w4GfIqwEFH5+ZYMYK" \
33+
-H "User-Agent: Mozilla/5.0 (compatible; check/0.1)" \
34+
https://ha2.digitalvio.shop/api/status | python3 -m json.tool
35+
# 应该看到: gateway_running: true, gateway_pid: 13823
1936
```
20-
⚠ Cannot restart gateway as a service — linger is not enabled.
21-
Run: sudo loginctl enable-linger root
22-
Then restart the gateway: hermes gateway restart
37+
38+
profile 名是 **`default`** (agent 没创新 profile, 复用 hermes 自带), 不是我之前写的 `aletheia-worker`. 派 task 时 `assignee` 必须填 `default`.
39+
40+
## 下面只剩 1 件事请你做 (可选, 提升稳定性)
41+
42+
worker 跑完 LLM 后**必须调 `kanban_done` 工具**才算 done, 不然 dispatcher 看到 task 还 running 会误判 crashed 并 re-spawn (浪费 DeepSeek 额度).
43+
44+
请在 `/root/.hermes/profiles/default/SOUL.md` (或新建一个) 加一行:
2345
```
46+
完成 task 后必须调用 kanban_done 工具标记 task 状态, 否则 dispatcher 会误判 crashed 重派.
47+
```
48+
49+
或者在每个 task body 末尾加 "请用 kanban_done 收尾" 的指引 (但每次都要写, 不如改 SOUL 一次到位).
2450

25-
**直接忽略**. 不要 enable-linger, 不要 restart gateway. 这跟我们的系统无关.
51+
---
2652

27-
`/api/status` 返回 `gateway_running=false` 是正常状态 — Hermes worker 跑 task **不依赖** gateway 状态.
53+
## 历史: 之前发给你的 3 步配置清单 (现已无效, 仅供参考)
54+
保留下面段落是历史, 实际操作不用做了 — agent 已替你完成. 只在你要换 LLM provider 或加新 profile 时才回头看.
2855

2956
---
3057

src/stores/useCanvasStore.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,9 @@ const useCanvasStore = create(
17421742
},
17431743

17441744
// 把 OntologyNode (entity/constraint/assumption) 转为 TaskNode 并自动派给 Hermes
1745-
// 不改原节点 — 在右侧建一个 TaskNode + 连线 + 立刻 dispatch
1745+
// OntologyNode "派 Hermes →" 按钮调这个 — 创建 TaskNode 走 orchestra auto 流.
1746+
// 真 Hermes worker (默认 profile=`default`, agent 已在 VPS 配好 deepseek-chat) 会接.
1747+
// 不走 manual hermes-proxy (那条要 gateway+token, 限制多), 走 orchestra conductor 抢锁更稳.
17461748
promoteOntologyToTask: async (ontoNodeId) => {
17471749
const { nodes } = get()
17481750
const src = nodes.find((n) => n.id === ontoNodeId)
@@ -1764,6 +1766,10 @@ const useCanvasStore = create(
17641766
status: 'draft',
17651767
from_ontology_node: ontoNodeId,
17661768
created_at: ts,
1769+
// orchestra auto 流: conductor 在 demo-final 房间会自动接管
1770+
agentMode: 'auto',
1771+
assignedTo: 'hermes',
1772+
hermesAssignee: 'default',
17671773
},
17681774
}
17691775
const newEdge = {
@@ -1779,11 +1785,8 @@ const useCanvasStore = create(
17791785
state.edges.push(newEdge)
17801786
})
17811787

1782-
// 立刻派单 (异步, 不阻塞)
1783-
get().dispatchTaskNode(taskId).catch((err) => {
1784-
console.error('[promoteOntologyToTask] auto-dispatch failed:', err)
1785-
})
1786-
1788+
// 不调 dispatchTaskNode (那是 manual 流) — orchestra dispatcher 看到
1789+
// agentMode='auto' + status='draft' 会自动推 pending → hermes worker 抢锁
17871790
return taskId
17881791
},
17891792

0 commit comments

Comments
 (0)