同步最新
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
---
|
||||
title: Hermes 编排 Agent + Web 可观测性方案
|
||||
date: 2026-04-29
|
||||
tags: [Hermes, Agent编排, ttyd, tmux, 可观测性]
|
||||
---
|
||||
|
||||
# Hermes 编排 Agent + Web 可观测性方案
|
||||
|
||||
## 背景
|
||||
|
||||
Hermes 作为母 Agent 编排不同的子 Agent(Codex、Claude Code 等),但全部在后台运行,无法直观看到每个 Agent 的实时输出和进度。需要将后台 tmux session 暴露到 Web 前端观察。
|
||||
|
||||
## 方案:ttyd + tmux
|
||||
|
||||
**ttyd**(GitHub 31k+ stars)可以把任意终端程序变成 Web 页面,通过 WebSocket 实时推流。
|
||||
|
||||
### 架构
|
||||
|
||||
```
|
||||
Hermes (编排大脑)
|
||||
│
|
||||
├─ tmux session codex1 ─── ttyd :8080 ──► http://localhost:8080
|
||||
├─ tmux session claude1 ─── ttyd :8081 ──► http://localhost:8081
|
||||
└─ tmux session codex2 ─── ttyd :8082 ──► http://localhost:8082
|
||||
```
|
||||
|
||||
### 使用方式
|
||||
|
||||
```bash
|
||||
# 启动 Agent 的 tmux session
|
||||
tmux new-session -d -s codex1 -x 140 -y 40
|
||||
tmux new-session -d -s claude1 -x 140 -y 40
|
||||
|
||||
# ttyd 暴露每个 session 到 web
|
||||
ttyd -p 8080 tmux attach -t codex1 &
|
||||
ttyd -p 8081 tmux attach -t claude1 &
|
||||
|
||||
# 浏览器打开
|
||||
open http://localhost:8080 # 看 Codex
|
||||
open http://localhost:8081 # 看 Claude Code
|
||||
```
|
||||
|
||||
### 类似方案
|
||||
- **Wetty / Gotty** — 与 ttyd 类似
|
||||
- **LangFuse / AgentOps** — 专业 Agent trace 平台,但偏事后日志分析,非实时终端画面
|
||||
|
||||
### 文件握手通信
|
||||
|
||||
Agent 之间通过文件交换上下文:
|
||||
|
||||
```
|
||||
/tmp/handoff.json # Codex 输出 → Claude Code 读取
|
||||
/tmp/instruction.md # Claude Code 重注入指令 → 拉起新 Codex
|
||||
/tmp/next_prompt.txt # 下一步指令
|
||||
```
|
||||
|
||||
## 关键结论
|
||||
|
||||
1. **不要** 让 Agent 之间直接互相调用(失控)
|
||||
2. **要** 用 Hermes 作为中央编排大脑
|
||||
3. **用文件作为 Agent 间通信协议**
|
||||
4. **ttyd 解决实时观察问题**,浏览器多标签同时查看所有 Agent
|
||||
|
||||
---
|
||||
|
||||
*来源:Hermes Agent 对话 (2026-04-29)*
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
tags:
|
||||
- AI
|
||||
---
|
||||
## 理想的AI编码流程
|
||||
- 策划发起需求
|
||||
- AI理解需求
|
||||
- harness工程执行
|
||||
- AI Review
|
||||
- 是否与需求对齐
|
||||
- 六大基本原则
|
||||
- hook发起PR
|
||||
- 经过CI
|
||||
- 编译门禁
|
||||
- 核心流程门禁
|
||||
- AirTest跑最主要的流程
|
||||
- 模块单例测试门禁
|
||||
- 异步与状态门禁
|
||||
|
||||
### 可验证是AI提高代码正确率的关键
|
||||
- AirTest编写最主要的几条流程作为验证
|
||||
- 是否可以正确投掷
|
||||
- 进行一轮跑测
|
||||
- error日志
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
###
|
||||
根据[[护栏与AI]]的流程,我还需要做
|
||||
- 云端部署harness
|
||||
- 围栏的搭建
|
||||
- AirTest的案例编写
|
||||
|
||||
Reference in New Issue
Block a user