# E2E Spec: AgentTeam Protocol

## Overview
Test the bidirectional WebSocket protocol between AgentTeam channel and the agentteam daemon.

## Existing Coverage (protocol_e2e_test.go)
- Ready message with 9 capabilities
- Ping/pong
- Deliver ack with agentId + seq
- Deliver dispatched to dispatcher
- Duplicate deliver dedup by agentId+seq
- Empty content deliver skipped
- Unknown message type handled gracefully
- Malformed JSON doesn't crash
- Sequential commands (ping + scan + workspace list + ping)
- Workspace list returns file tree
- Workspace read distinguishes text vs binary
- Machine scan with directory stats
- Machine delete actually deletes

## Additional Test Cases Needed

### Agent Lifecycle
- `agent:start` command starts agent, returns wake status
- `agent:stop` command stops agent
- `agent:interrupt` command interrupts current agent run without clearing session
- `agent:sleep` command sleeps agent (session retained)
- `agent:deliver` after sleep is rejected so the server falls back to lifecycle-owning `agent:start`

### Workspace Operations
- `agent:workspace:read` non-existent file returns error
- `agent:workspace:read` with requestId includes requestId in response
- `agent:reset-workspace` clears workspace

### Recovery
- `agent:restore_recovery_point` restores from checkpoint
- `agent:gc_recovery_points` cleans up old artifacts

### Edge Cases
- WebSocket reconnection behavior
- Large message handling
- Multiple concurrent sessions
- Deliver with various metadata fields (channel_type, channel_name, sender)
