Repository navigation
Closed
Labels
Description
Overview
Comprehensive integration tests validating the complete agent pipeline from frontend interaction through Tauri commands to backend execution and back. Covers both local agent and ACP agent workflows, error scenarios, and performance benchmarking.
Acceptance Criteria
- Local agent E2E: full conversation round-trip with tool use via Tauri commands
- Model lifecycle E2E: download -> verify -> load -> inference -> unload -> delete
- ACP E2E: session lifecycle with mock agent subprocess (echo server)
- Context assembly E2E: select nodes, assemble context, verify output structure
- Concurrent operations: local agent conversation while ACP session active (no crash/deadlock)
- Error: agent with no model loaded returns appropriate error
- Error: ACP agent binary not found returns helpful message
- Error: transport failure mid-session transitions to Failed state
- Error: context assembly with nonexistent node IDs handled gracefully
- Performance benchmarks documented: TTFT, tokens/sec, context assembly time, tool execution latency
- All tests runnable via standard test commands
- CI-compatible: tests work without GPU (use CPU fallback or mock inference)
- Code passes
bun run quality:fix
Technical Specifications
Test Categories
1. Local Agent E2E
- Send message via
local_agent_sendcommand - Verify streaming events arrive on
local-agent://chunkchannel - Verify tool calls execute against real NodeService (with test data)
- Verify final response contains synthesized information
- Test multi-turn conversation with history persistence
2. Model Lifecycle E2E
- Call
model_list— verify catalog returned - Call
model_recommended— verify RAM-appropriate model selected - Call
model_downloadwith test fixture (small file or mock) - Verify progress events on
model://download-progress - Call
model_load— verify model transitions to Loaded - Run inference through local agent
- Call
model_unloadandmodel_delete— verify cleanup
3. ACP E2E
- Create a simple test agent script (echo server that speaks NDJSON)
- Call
acp_start_sessionwith test agent - Verify initialization handshake completes
- Send message, verify response forwarded
- Call
acp_end_session, verify clean teardown - Verify context assembly includes correct nodes in initial prompt
4. Concurrent Operations
- Start local agent session
- Start ACP session simultaneously
- Send messages to both
- Verify neither crashes, deadlocks, or interferes
5. Error Scenarios
local_agent_sendwith no model loaded -> clear erroracp_start_sessionwith nonexistent binary -> "Not installed" error- Kill mock agent process mid-session -> Failed state with diagnostic
acp_start_sessionwith nodes that do not exist -> graceful degradationmodel_downloadwith insufficient disk space -> clear error
6. Performance Benchmarks
Track and document (not pass/fail):
- Time to first token (TTFT) for 3B and 8B models
- Tokens per second during streaming
- Context assembly time for 5, 10, 20 selected nodes
- Tool execution latency per tool type
- Model load time
Test Infrastructure
Mock Agent for ACP Tests:
- Simple script (shell or Rust binary) that:
- Reads NDJSON from stdin
- Responds to
initializewith capabilities - Echoes
session/promptmessages back - Exits cleanly on close signal
Test Data Setup:
- Create test nodes via NodeService in test setup
- Create relationships between test nodes
- Generate embeddings for semantic search tests
- Tear down all test data in test cleanup
Reference Files
packages/desktop-app/src-tauri/src/commands/— commands being testedpackages/core/src/playbook/tests.rs— existing integration test patternssrc/tests/— frontend test patterns
Dependencies
- Tauri command layer: wire frontend to agent backend services #1008 (Tauri command layer — all wiring must be complete)
Related Issues
- ACP Integration and Local LLM Capability #997 (parent epic)
Activity
malibio commentedon Apr 4, 2026
Baseline: 124 test files passed, 3850 tests passed (frontend). Starting E2E agent integration test implementation.
test: end-to-end integration tests for agent subsystems (closes #1009)
test: end-to-end integration tests for agent subsystems (closes #1009) (