feat(acp): add Agent Client Protocol support with daemon relay#625
Open
feat(acp): add Agent Client Protocol support with daemon relay#625
Conversation
Integrate ACP (JSON-RPC 2.0 over stdio) as a new runtime mode alongside PTY-based terminal sessions. The daemon acts as a transparent byte relay, spawning ACP agent processes and tunneling stdio between clients and agents without parsing ACP messages. New kild-acp crate wraps the agent-client-protocol SDK behind a Send+Sync API using a dedicated single-threaded tokio runtime. Agents declare ACP support via acp_command() on AgentBackend (claude, gemini, opencode). CLI: --acp flag on create/open, [acp] badge in list, attach refused. Daemon: ACP process spawn with stdin/stdout/exit relay tasks. UI: ACP badge in sidebar, terminal tab guard for ACP sessions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kild-acpcrate,RuntimeMode::Acpvariant, ACP daemon relay (transparent byte tunnel),--acpCLI flag, agent backend ACP command declarations, UI awarenessLabel Snapshot (required)
risk: mediumsize: Lcore,agent,daemon,runtimeagent:claude,agent:gemini,agent:opencodeChange Metadata
featureruntimeLinked Issue
Validation Evidence (required)
kild create test-acp --acp→ daemon spawnedclaude-code-acp(PID confirmed) →kild listshowedruntime_mode: acp→kild stopkilled process →kild destroycleaned up.Security Impact (required)
Privacy and Data Hygiene (required)
passCompatibility / Migration
--acpflag, all existing PTY sessions unchangedHuman Verification (required)
claude-code-acp, verify process running viaps, checkruntime_mode: acpin JSON list output, stop session, destroy session--acpconflicts with--daemon/--no-daemon(clap error), attach refused for ACP sessionsSide Effects / Blast Radius (required)
kild-acpcrate (standalone, no internal deps),kild-protocol(new message types — non_exhaustive enums),kild-daemon(new acp/ module), agent backends (new trait method with default None), CLI (new flag), UI (badge + guard)Rollback Plan (required)
git revert <commit>— single commit, clean revert--acpflag is opt-in, no config changeskild create --acpwould fail to spawn agent process,kild listwould not show ACP sessionsRisks and Mitigations
agent-client-protocolv0.9) is pre-1.0 and API may changeArchitecture
New crate: kild-acp
Wraps the
agent-client-protocolSDK behind aSend+SyncAPI. The SDK produces!Sendfutures, so the crate spawns a dedicated OS thread with a single-threaded tokio runtime +LocalSet. External callers communicate via mpsc channels.Files changed (32 files, +1698/-71)
File list
Cargo.lock/Cargo.toml— workspace dependency additionscrates/kild-acp/— new crate (6 files: lib, errors, types, client_impl, connection, runner)crates/kild-protocol/src/types.rs—RuntimeMode::Acpcrates/kild-protocol/src/messages.rs— 6 new ACP message typescrates/kild-core/src/agents/traits.rs—acp_command()method +AcpCommandInfocrates/kild-core/src/agents/backends/mod.rs— 2 new macro arms for ACP agentscrates/kild-core/src/agents/registry.rs—get_acp_command(),supports_acp()crates/kild-core/src/agents/mod.rs— re-exportscrates/kild-core/src/daemon/client.rs—create_acp_session()crates/kild-core/src/sessions/daemon_spawn.rs—spawn_acp_agent()crates/kild-core/src/sessions/daemon_helpers.rs— env var builder for ACPcrates/kild-core/src/sessions/create.rs— ACP runtime mode dispatchcrates/kild-core/src/sessions/open.rs— ACP session reopencrates/kild-daemon/src/acp/— new module (mod.rs + relay.rs)crates/kild-daemon/src/server/connection.rs— dispatch 3 ACP message typescrates/kild-daemon/src/session/manager.rs—create_acp_session(),write_acp_stdin()crates/kild-daemon/src/lib.rs— acp module declarationcrates/kild-ui/src/views/sidebar.rs— ACP badgecrates/kild-ui/src/views/main_view/kild_handlers.rs— terminal tab guardcrates/kild/src/app/session.rs—--acpflag definitioncrates/kild/src/commands/create.rs— read acp flagcrates/kild/src/commands/open.rs—[acp]mode labelcrates/kild/src/commands/attach.rs— refuse attach for ACPcrates/kild/src/commands/helpers.rs—resolve_runtime_mode()with ACP