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:
parent
6efca09018
commit
1bc7580ecc
15 changed files with 435 additions and 2367 deletions
|
|
@ -0,0 +1,31 @@
|
|||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Orchestrator exposes status via API only
|
||||
Orchestrator SHALL 通过 HTTP API 暴露所有任务和 Agent 状态信息,不连接任何外部聊天或通知平台。平台接入由各 Agent 自行处理。
|
||||
|
||||
#### Scenario: Task state change queryable via API
|
||||
- **WHEN** 任务 #42 状态变更(assigned、completed、failed 等)
|
||||
- **THEN** 变更 SHALL 通过 `GET /api/v1/tasks` API 可查询
|
||||
- **AND** 变更 SHALL 记录在 task_events 表中
|
||||
|
||||
#### Scenario: Agent state change queryable via API
|
||||
- **WHEN** Agent `worker-03` 状态变更(online、offline 等)
|
||||
- **THEN** 变更 SHALL 通过 `GET /api/v1/agents` API 可查询
|
||||
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: Matrix room as coordination channel
|
||||
**Reason**: Orchestrator 不连接任何聊天平台。平台接入是 Agent 侧的职责。
|
||||
**Migration**: 各 Agent(OpenClaw/Jeeves、Hermes 等)自行连接聊天平台,通过 Orchestrator HTTP API 获取状态后展示。
|
||||
|
||||
### Requirement: Slash commands for orchestration
|
||||
**Reason**: Orchestrator 不处理命令。命令解析和路由由各 Agent 自行处理。
|
||||
**Migration**: 各 Agent 解析用户命令,调用 Orchestrator HTTP API 执行操作。
|
||||
|
||||
### Requirement: Matrix notifications for receipts
|
||||
**Reason**: Orchestrator 不推送通知。通知由各 Agent 根据所在平台能力自行处理。
|
||||
**Migration**: Agent 通过 API 轮询或 webhook 获取 receipt 状态变更,自行决定通知方式和格式。
|
||||
|
||||
### Requirement: Per-agent Matrix thread
|
||||
**Reason**: Orchestrator 不了解任何聊天平台概念。展示方式由各 Agent 根据平台能力决定。
|
||||
**Migration**: Agent 通过 `GET /api/v1/tasks?agent_id=xxx` 获取任务历史,自行选择展示方式。
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
## ADDED Requirements
|
||||
|
||||
### Requirement: Task list API endpoint
|
||||
Orchestrator SHALL 提供 `GET /api/v1/tasks` 端点,返回任务列表的结构化 JSON。
|
||||
|
||||
#### Scenario: List all tasks
|
||||
- **WHEN** 发送 `GET /api/v1/tasks`
|
||||
- **THEN** SHALL 返回 JSON 数组,每项包含:task_id, source, task_type, priority, status, assigned_agent_id, retry_count, max_retries, created_at, assigned_at, started_at, completed_at
|
||||
|
||||
#### Scenario: Filter by status
|
||||
- **WHEN** 发送 `GET /api/v1/tasks?status=running`
|
||||
- **THEN** SHALL 仅返回 status 为 `running` 的任务
|
||||
|
||||
#### Scenario: Filter by agent
|
||||
- **WHEN** 发送 `GET /api/v1/tasks?agent_id=worker-03`
|
||||
- **THEN** SHALL 仅返回 assigned_agent_id 为 `worker-03` 的任务
|
||||
|
||||
### Requirement: Task retry API endpoint
|
||||
Orchestrator SHALL 提供 `POST /api/v1/tasks/{task_id}/retry` 端点。
|
||||
|
||||
#### Scenario: Retry a failed task
|
||||
- **WHEN** 发送 `POST /api/v1/tasks/org/repo#42/retry`
|
||||
- **AND** 任务当前状态为 `failed` 或 `agent_lost`
|
||||
- **THEN** SHALL 将任务状态转换为 `assigned`,返回更新后的任务 JSON
|
||||
|
||||
#### Scenario: Retry a non-retryable task
|
||||
- **WHEN** 发送 `POST /api/v1/tasks/org/repo#42/retry`
|
||||
- **AND** 任务当前状态不是 `failed` 或 `agent_lost`
|
||||
- **THEN** SHALL 返回 400 错误,说明任务不在可重试状态
|
||||
Loading…
Add table
Add a link
Reference in a new issue