feat: complete acp-go-sdk integration with task state updates

- Use acp-go-sdk for all ACP communication in agentctl
- Mark agent as completed when Prompt() returns successfully
- Update task state to COMPLETED when agent completes
- Update task state to FAILED when agent fails and retries exhausted
- Enhanced E2E test to verify agent actually creates files
- E2E test now validates full flow: task creation -> agent work -> file creation -> task completion
This commit is contained in:
jcfs
2026-01-10 16:46:22 +00:00
parent 214b6ed2d8
commit 20f5f43fb3
143 changed files with 2750 additions and 296 deletions
+2 -2
View File
@@ -370,12 +370,12 @@ Kandev uses the **Agent Communication Protocol (ACP)** - an open protocol for co
The backend implements full ACP support with:
1. **Session Management** (`backend/internal/agent/acp/session.go`)
1. **Session Management** (`apps/backend/internal/agent/acp/session.go`)
- Create sessions with `session/new`
- Send prompts with `session/prompt`
- Resume sessions with stored session IDs
2. **JSON-RPC Client** (`backend/pkg/acp/jsonrpc/client.go`)
2. **JSON-RPC Client** (`apps/backend/pkg/acp/jsonrpc/client.go`)
- Handles responses to client requests
- Handles notifications from agent (`session/update`)
- Handles requests from agent (`session/request_permission`)
+39 -36
View File
@@ -44,7 +44,7 @@
### Step 1: Build the Backend
```bash
cd backend
cd apps/backend
# Build the binary
make build
@@ -142,7 +142,7 @@ The project includes a comprehensive E2E test script:
```bash
# Build the agent Docker image first
cd backend/dockerfiles/augment-agent
cd apps/backend/dockerfiles/augment-agent
docker build -t kandev/augment-agent:latest .
# Run the E2E test
@@ -175,14 +175,14 @@ The E2E test:
### Build
```bash
cd backend
cd apps/backend
make build
```
### Run Tests
```bash
cd backend
cd apps/backend
make test
# Or with verbose output
@@ -200,7 +200,7 @@ go vet ./...
```bash
# SQLite CLI
sqlite3 backend/kandev.db
sqlite3 apps/backend/kandev.db
# List tables
.tables
@@ -217,35 +217,38 @@ SELECT * FROM tasks;
## Project Structure
```
backend/
├── cmd/kandev/ # Main entry point
│ └── main.go
├── internal/
│ ├── agent/ # Agent management
│ │ ├── acp/ # ACP session management
│ │ ├── api/ # Agent HTTP handlers
│ │ ├── credentials/ # Credential providers
│ │ ├── docker/ # Docker client
│ │ ├── lifecycle/ # Container lifecycle
│ │ └── registry/ # Agent type registry
│ ├── task/ # Task management
│ │ ├── api/ # Task HTTP handlers
│ │ ├── models/ # Data models
│ │ ├── repository/ # SQLite/Memory storage
│ │ └── service/ # Business logic
│ ├── orchestrator/ # Orchestration logic
│ ├── events/ # In-memory event bus
│ └── common/ # Shared utilities
│ └── logger/ # Zap logger
├── pkg/acp/ # ACP protocol types
│ └── jsonrpc/ # JSON-RPC 2.0 client
├── dockerfiles/ # Agent Dockerfiles
│ └── augment-agent/
├── bin/ # Built binaries (gitignored)
├── Makefile
└── NEXT_STEPS.md # Development roadmap
scripts/
└── e2e-test.sh # End-to-end test script
kandev/
├── apps/
│ ├── backend/ # Go backend services
│ │ ├── cmd/kandev/ # Main entry point
│ │ │ └── main.go
│ │ ├── internal/
│ │ │ ├── agent/ # Agent management
│ │ │ │ ├── acp/ # ACP session management
│ │ │ │ ├── api/ # Agent HTTP handlers
│ │ │ │ ├── credentials/ # Credential providers
│ │ │ │ ├── docker/ # Docker client
│ │ │ │ ├── lifecycle/# Container lifecycle
│ │ │ │ └── registry/ # Agent type registry
│ │ │ ├── task/ # Task management
│ │ │ │ ├── api/ # Task HTTP handlers
│ │ │ │ ├── models/ # Data models
│ │ │ │ ├── repository/ # SQLite/Memory storage
│ │ │ │ └── service/ # Business logic
│ │ │ ├── orchestrator/ # Orchestration logic
│ │ │ ├── events/ # In-memory event bus
│ │ │ └── common/ # Shared utilities
│ │ │ └── logger/ # Zap logger
│ │ ├── pkg/acp/ # ACP protocol types
│ │ │ └── jsonrpc/ # JSON-RPC 2.0 client
│ │ ├── dockerfiles/ # Agent Dockerfiles
│ │ │ └── augment-agent/
│ │ ├── bin/ # Built binaries (gitignored)
│ │ └── Makefile
│ └── web/ # Frontend application
├── scripts/
│ └── e2e-test.sh # End-to-end test script
└── docs/ # Documentation
```
---
@@ -274,7 +277,7 @@ kill -9 <PID>
```bash
# Delete and recreate database
rm backend/kandev.db
rm apps/backend/kandev.db
./bin/kandev # Will create fresh database
```
@@ -295,4 +298,4 @@ docker rm $(docker ps -a -q --filter "label=kandev.managed=true")
## Next Steps
See [NEXT_STEPS.md](../backend/NEXT_STEPS.md) for the development roadmap and immediate next steps.
See [NEXT_STEPS.md](../apps/backend/NEXT_STEPS.md) for the development roadmap and immediate next steps.