Create Agent instance management API endpoints #30

Closed
opened 2025-12-29 23:48:23 +00:00 by cardosofelipe · 0 comments

Description

Implement REST API endpoints for AgentInstance lifecycle management.

Requirements

Endpoints

POST   /api/v1/projects/{pid}/agents              - Spawn agent
GET    /api/v1/projects/{pid}/agents              - List project agents
GET    /api/v1/projects/{pid}/agents/{id}         - Get agent details
PATCH  /api/v1/projects/{pid}/agents/{id}         - Update agent
POST   /api/v1/projects/{pid}/agents/{id}/pause   - Pause agent
POST   /api/v1/projects/{pid}/agents/{id}/resume  - Resume agent
DELETE /api/v1/projects/{pid}/agents/{id}         - Terminate agent
GET    /api/v1/projects/{pid}/agents/{id}/metrics - Get agent metrics

Authorization

  • Project owner or superuser only
  • Agents scoped to projects

Response Schema

Include status, current task, metrics, and memory summary.

Tests

  • All endpoints
  • Project ownership check
  • Status transitions
  • Metrics calculation

Acceptance Criteria

  • All endpoints implemented
  • Project scoping enforced
  • Status transitions validated
  • Metrics endpoint accurate
  • Integration tests
  • OpenAPI schema updated

Dependencies

  • Depends on: #23 (Project), #25 (AgentInstance)

Assignable To

backend-engineer agent

## Description Implement REST API endpoints for AgentInstance lifecycle management. ## Requirements ### Endpoints ``` POST /api/v1/projects/{pid}/agents - Spawn agent GET /api/v1/projects/{pid}/agents - List project agents GET /api/v1/projects/{pid}/agents/{id} - Get agent details PATCH /api/v1/projects/{pid}/agents/{id} - Update agent POST /api/v1/projects/{pid}/agents/{id}/pause - Pause agent POST /api/v1/projects/{pid}/agents/{id}/resume - Resume agent DELETE /api/v1/projects/{pid}/agents/{id} - Terminate agent GET /api/v1/projects/{pid}/agents/{id}/metrics - Get agent metrics ``` ### Authorization - Project owner or superuser only - Agents scoped to projects ### Response Schema Include status, current task, metrics, and memory summary. ### Tests - All endpoints - Project ownership check - Status transitions - Metrics calculation ## Acceptance Criteria - [ ] All endpoints implemented - [ ] Project scoping enforced - [ ] Status transitions validated - [ ] Metrics endpoint accurate - [ ] Integration tests - [ ] OpenAPI schema updated ## Dependencies - Depends on: #23 (Project), #25 (AgentInstance) ## Assignable To backend-engineer agent
cardosofelipe added the backendphase-1 labels 2025-12-29 23:49:59 +00:00
Sign in to join this conversation.