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,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