agent-fleet/openspec/changes/chatops-architecture-revision/proposal.md
Zer4tul 1bc7580ecc 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.
2026-05-12 10:59:19 +08:00

2.1 KiB
Raw Blame History

Why

agent-fleet 当前实现了一个独立的 Matrix bot 连接matrix-sdk直接处理 ChatOps 命令和通知推送。这违反了架构职责分离原则:

  1. Session 冲突@jeeves:0x08.org 已被 OpenClaw 占用
  2. 架构冗余agent-fleet 重新实现了消息收发、命令路由、通知推送
  3. 违背最小化原则agent-fleet 的核心价值是编排引擎任务队列、状态机、receipt 验证),不是聊天界面
  4. 平台绑定:硬编码 Matrix 协议,但 agent-fleet 作为纯 API 服务应该是平台无关的

agent-fleet 应该是一个纯 HTTP API 服务不知道也不关心聊天平台的存在。平台接入Telegram、Matrix、Feishu 等)完全是 Agent 侧的事情:

  • OpenClaw/Jeeves 自己连接多个平台
  • Hermes Agent 自己连接 Telegram 或 Matrix
  • Claude Code / Codex / OpenCode 通过 cc-connect 等扩展工具连接平台

What Changes

  • BREAKING: 移除 src/integrations/matrix/ 中的独立 Matrix bot 实现
  • 移除通知格式化函数(不属于编排引擎的职责)
  • 新增 GET /api/v1/tasks 端点(任务列表查询,支持过滤)
  • 新增 POST /api/v1/tasks/{id}/retry 端点(任务重试)
  • config.toml 移除 [matrix] section
  • Cargo.toml 移除 matrix-sdk 依赖

Capabilities

New Capabilities

  • task-api-endpoints: 任务查询和操作 HTTP API 端点(GET /api/v1/tasks, POST /api/v1/tasks/{id}/retry),返回结构化 JSON

Modified Capabilities

  • matrix-chatops: 移除独立 bot 连接和 ChatOps 功能。Orchestrator 只负责暴露 HTTP API不涉及任何聊天平台集成。本 capability 修订后实质上变为"Orchestrator API 暴露足够信息供外部 Agent 展示"。

Impact

  • 代码:删除 src/integrations/matrix/ 目录及相关引用
  • API:新增 2 个端点,无破坏性变更
  • 配置config.toml 移除 [matrix] section
  • 依赖:从 Cargo.toml 移除 matrix-sdk
  • 职责边界agent-fleet 只返回结构化 JSON不关心如何展示给人类