Files
kandev/docs/plans/custom-acp-agents/task-01-operator-registered-acp-agents.md
T
João Manso f2d52f1826 feat(agents): let a custom agent speak ACP (#3863)
Co-authored-by: Joao Manso <X363081@bcpcorp.net>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2026-09-23 11:01:32 +01:00

3.4 KiB

id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
id title status wave depends_on plan requirements acceptance_criteria system_design
01-operator-registered-acp-agents Let an operator-registered agent declare and run ACP in_progress 1
plan.md
REQ-AGENTS-CUSTOM-ACP-001
AC-AGENTS-CUSTOM-ACP-001.1
AC-AGENTS-CUSTOM-ACP-001.2
AC-AGENTS-CUSTOM-ACP-001.3
AC-AGENTS-CUSTOM-ACP-001.4
AC-AGENTS-CUSTOM-ACP-001.5
AC-AGENTS-CUSTOM-ACP-001.6
AC-AGENTS-CUSTOM-ACP-001.7
../../specs/agents/system-design/custom-acp-agents.md

Task 01: Operator-registered ACP agents

Summary

Make the discovery sweep read the live agent registry, add a protocol to the operator-registered definition, and let the capability probe spawn the command that definition names.

In scope

  • internal/agent/discovery: resolve agents per sweep, generation-fence the result cache, drop the dead KnownAgent/Definitions() capture.
  • internal/agent/settings/controller: invalidate after each registry mutation; persist the protocol; seed an ACP profile as non-passthrough and probe it; share one spec builder.
  • internal/agent/agents: add CustomACPAgent; mark its command operator-defined.
  • internal/agent/registry: build the agent the protocol names; reject unknown protocols and an ACP-plus-strategy pair.
  • internal/agentctl/server/utility: resolveSpawnCommand accepts an operator-defined command.
  • apps/web: protocol selector; hide the model and MCP fields for ACP; stop calling the dialog a TUI agent.

Acceptance

  • AC-AGENTS-CUSTOM-ACP-001.1 Creating an agent makes it appear in Installed Agents and deleting it makes it disappear, with no backend restart and without Rescan re-detecting the deleted binary.
  • AC-AGENTS-CUSTOM-ACP-001.2 A membership change is visible before the cache TTL, and a sweep that started before the invalidation does not publish its results.
  • AC-AGENTS-CUSTOM-ACP-001.3 A definition with no protocol still registers a *TUIAgent and is still classified passthrough-only.
  • AC-AGENTS-CUSTOM-ACP-001.4 An ACP definition registers an agent with Runtime().Protocol = ACP that implements InferenceAgent, is not passthrough-only, and offers no passthrough config.
  • AC-AGENTS-CUSTOM-ACP-001.5 Creating an ACP agent seeds one profile with CLIPassthrough = false and an empty model, and starts a capability probe for that agent only.
  • AC-AGENTS-CUSTOM-ACP-001.6 An unknown protocol and an ACP-plus-MCP-strategy pair are both refused, at creation and on the MCP-strategy route, with no row written.
  • AC-AGENTS-CUSTOM-ACP-001.7 The probe spawns an operator-defined command and still refuses an unlisted command that is not operator-defined.

Verification

  • RED/GREEN Go: internal/agent/discovery, internal/agent/registry, internal/agent/agents, internal/agent/settings/controller, internal/agentctl/server/utility.
  • Web: add-tui-agent-dialog.test.tsx, custom-tui-mcp-mount.test.tsx.
  • E2E: e2e/tests/settings/custom-acp-agent.spec.ts.
  • make lint-backend, web typecheck, web i18n:check.

Not verified

No real ACP session has completed end to end. The CLI used during development fails session/new against its own model-catalogue service in every mode, reproduced outside Kandev with acpdbg and with a hand-written JSON-RPC client, so the spawn, initialize, authenticate, and session/new path is confirmed correct but the last mile waits on that service.