Skip to content

ACP agent registry with binary detection and health checking #1002

Closed

Description

@malibio

Overview

Implement the agent registry that discovers available external ACP agents on the user system and maintains their availability status. This enables the frontend to show which coding agents are available and the ACP session manager to verify agent availability before spawning.

Acceptance Criteria

  • AgentRegistry trait from Shared types, traits, and interface contracts for agent subsystems #998 fully implemented
  • Correctly detects installed binaries via PATH search
  • Health check runs version probe for each detected agent
  • Auth validation: flags agents with missing env vars as unavailable
  • Cached results with 5-minute TTL (no re-probe on every call)
  • Background refresh updates availability status periodically
  • Handles edge cases: binary exists but not executable, binary is a different tool with same name
  • Unit tests with mock filesystem/PATH
  • Code passes bun run quality:fix

Technical Specifications

New Modules

  • packages/desktop-app/src-tauri/src/acp/registry.rs
  • packages/desktop-app/src-tauri/src/acp/health.rs

Agent Catalog (Hardcoded v1)

Agent Binary Args Auth Health Check
Claude Code claude ["--acp"] AgentManaged (OAuth) which claude
Gemini CLI gemini ["--acp"] AgentManaged (OAuth) which gemini
Mistral Vibe vibe-acp [] EnvApiKey(MISTRAL_API_KEY) which vibe-acp

Binary Detection

  • Use which crate or std::process::Command with which to check PATH
  • Cache results with TTL (5 minutes default)
  • Re-probe on explicit refresh or background timer

Health Checking

  • For each detected binary, run lightweight version probe (e.g., claude --version)
  • Validate response indicates expected tool
  • Mark as unavailable if probe fails or times out (5s timeout per probe)

Auth Validation

  • For EnvApiKey agents: check env var existence (std::env::var())
  • Do not validate key contents, just check existence
  • Missing env var -> agent shown as "Not configured" (not "Not installed")

Background Monitoring

  • Periodic check every 5 minutes via tokio interval
  • Emit availability change events when status changes
  • Lazy start: first check triggers on first discover_agents() call

Reference Files

  • packages/desktop-app/src-tauri/src/app_services.rs — service lifecycle patterns

Exports

  • SystemAgentRegistry struct implementing AgentRegistry

Dependencies

Related Issues

Activity

  1. malibio commented on Apr 3, 2026

    @malibio
    CollaboratorAuthor

    Baseline: frontend tests have pre-existing vitest startup error (TypeError: Attempted to assign to readonly property in vitest internals). This is unrelated to Rust backend work for this issue.

  2. self-assigned this
    on Apr 3, 2026
  3. added 3 commits that reference this issue on Apr 3, 2026
    944d082
    b2030b2
    e5b534f
  4. added a commit that references this issue on Jun 22, 2026
    755a9e6
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