refactor: remove Matrix bot, make agent-fleet platform-agnostic API service

- Remove src/integrations/matrix/ (bot connection, command parsing, notification formatting)
- Remove matrix-sdk dependency from Cargo.toml
- Remove MatrixConfig from config.rs and [matrix] from config.example.toml
- Add GET /api/v1/tasks (list with status/agent_id filter)
- Add POST /api/v1/tasks/{task_id}/retry (Failed/AgentLost → Assigned)
- Add EventStore::list_tasks() with parameterized query
- 29/29 tests pass

Platform integration (Telegram, Matrix, Feishu) is Agent-side responsibility.
agent-fleet is now a pure HTTP API orchestration engine.
This commit is contained in:
Zer4tul 2026-05-12 10:59:19 +08:00
parent 6efca09018
commit 1bc7580ecc
15 changed files with 435 additions and 2367 deletions

View file

@ -0,0 +1,22 @@
## 1. 移除 Matrix bot 和通知格式化代码
- [ ] 1.1 删除 `src/integrations/matrix/` 目录
- [ ] 1.2 从 `src/integrations/mod.rs` 移除 `pub mod matrix;`
- [ ] 1.3 从 `src/main.rs` 移除 Matrix bot 启动逻辑
- [ ] 1.4 从 `Cargo.toml` 移除 `matrix-sdk` 依赖
- [ ] 1.5 从 `config.example.toml` 移除 `[matrix]` section
- [ ] 1.6 从 `src/config.rs` 移除 `MatrixConfig` struct 及相关字段
- [ ] 1.7 删除通知格式化函数和命令解析代码(如已从 matrix 模块导出)
## 2. 新增 HTTP API 端点
- [ ] 2.1 实现 `GET /api/v1/tasks`:返回任务列表 JSON支持 `status``agent_id` 查询参数过滤
- [ ] 2.2 实现 `POST /api/v1/tasks/{task_id}/retry`:对 failed/agent_lost 任务触发重新入队,非可重试状态返回 400
- [ ] 2.3 在 EventStore 中添加 `list_tasks(status: Option<&str>, agent_id: Option<&str>)` 查询方法
- [ ] 2.4 在 `src/main.rs` 注册新路由
## 3. 测试与验证
- [ ] 3.1 `cargo check` 通过(无 matrix-sdk 依赖)
- [ ] 3.2 `cargo test` 全部通过(移除 matrix 相关测试,新增 API 端点测试)
- [ ] 3.3 新增 API 端点测试:任务列表过滤、重试成功、重试失败场景