auto-sync: 2026-05-16 23:34:26

This commit is contained in:
cfdaily
2026-05-16 23:34:26 +08:00
parent baf7ddb32c
commit 9620fbc7a4
2 changed files with 161 additions and 7 deletions
+7 -6
View File
@@ -41,16 +41,17 @@ PM2 (进程管理器)
进程内部结构:
sanguo-moziplus-v2
├── uvicorn (FastAPI)
├── uvicorn (FastAPI) — asyncio event loop
│ ├── API 路由(黑板/Daemon/SSE/项目)
│ ├── 静态文件服务(frontend/dist/
│ └── SSE 推送端点(/api/events
├── asyncio background task: Daemon ticker30s
├── asyncio background task: Inbox watcher1s 轮询)
── ActiveAgentCounter(异步信号量
── Agent spawn: asyncio.create_subprocess_exec(异步非阻塞
└── ActiveAgentCounterasyncio.Semaphore
```
**关键:v2 是单进程。** Daemon ticker 和 API 在同一个 asyncio event loop 中。不新增 PM2 进程。
**纯 asyncio 单线程。** Daemon ticker、API、SSE、Agent spawn 全部在同一个 asyncio event loop 中,无同步阻塞调用。Full Agent spawn 用 `asyncio.create_subprocess_exec`(不 await 完成),Subagent 用 Gateway 内部 API。不新增 PM2 进程。
---
@@ -376,9 +377,9 @@ Phase 4: v1 下线
├── v2 可选接管 8082
└── v1 代码和数据库保留只读(历史归档)
Phase 5: Mail 逐步下线
├── 黑板评论替代 Mail 协作
├── 逐个 Agent 关闭 Mail poller
Phase 5: Mail 逐步下线(远期目标,与黑板评论长期共存)
├── v2 上线后 Mail 和黑板评论并行
├── 所有 Agent 的 Skill 更新支持黑板评论后逐步关闭 Mail poller
└── 最终只保留 Mail 作为外部通知通道
```