# E2E Spec: Agent REST API

## Overview
Test read-only `/api/internal/agents` REST endpoints. Agent definitions are
synced from remote AgentTeam servers; local REST APIs only list and fetch them.

## Setup
Use `failpoint.Enable("agentteam-config-dir", ...)` with a temp directory to isolate state.
Construct a minimal Gin router with agent endpoints registered.

## Test Cases

### GET /api/internal/agents
- Returns 200 with empty array when no agents exist
- Returns 200 with synced agent list after seeding an AgentTeam-sourced agent

### GET /api/internal/agents/:id
- Returns 200 with agent details
- Returns 404 for nonexistent agent

### Local Mutation Endpoints
- `POST /api/internal/agents` is not registered and returns 404
- `PUT /api/internal/agents/:id` is not registered and returns 404
- `DELETE /api/internal/agents/:id` is not registered and returns 404

### Persistence
- Agent records seeded as AgentTeam-sourced entries in `agents.yaml` are returned by the read-only API
- New Manager loading the same directory sees the seeded synced agent
