Skip to content

End-to-end integration tests for agent subsystems #1009

Closed

Description

@malibio

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_send command
  • Verify streaming events arrive on local-agent://chunk channel
  • 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_download with 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_unload and model_delete — verify cleanup

3. ACP E2E

  • Create a simple test agent script (echo server that speaks NDJSON)
  • Call acp_start_session with 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_send with no model loaded -> clear error
  • acp_start_session with nonexistent binary -> "Not installed" error
  • Kill mock agent process mid-session -> Failed state with diagnostic
  • acp_start_session with nodes that do not exist -> graceful degradation
  • model_download with 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 initialize with capabilities
    • Echoes session/prompt messages 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 tested
  • packages/core/src/playbook/tests.rs — existing integration test patterns
  • src/tests/ — frontend test patterns

Dependencies

Related Issues

Activity

  1. malibio commented on Apr 4, 2026

    @malibio
    CollaboratorAuthor

    Baseline: 124 test files passed, 3850 tests passed (frontend). Starting E2E agent integration test implementation.

  2. self-assigned this
    on Apr 4, 2026
  3. added a commit that references this issue on Apr 4, 2026
    1b5b3a1
  4. added a commit that references this issue on Jun 22, 2026
    f5c92b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions