Skip to content

ed-acp-tauri: run an external ACP agent over stdio - #48

Merged
setoelkahfi merged 2 commits into
mainfrom
feature/acp-external-agent
Nov 2, 2026
Merged

setoelkahfi merged 2 commits into
mainfrom
feature/acp-external-agent

Conversation

@setoelkahfi

Copy link
Copy Markdown
Collaborator

AgentState::external starts a child process that speaks ACP over stdio, such as Anthropic's claude through claude-agent-acp, and serves it with the same client as the in-process agent: session updates, permission prompts, fs/* inside the session roots and URL elicitation. The child is killed when the connection ends, on logout, or when the state is dropped.

ExternalConfig carries the command, args, extra env, client name and version, and the same roots, mcp_servers and events hooks as HostConfig.

sigit-app needs this to offer a Claude.ai subscription through Anthropic's own CLI. It is an addition to the public API of ed-acp-tauri, and the in-process path is unchanged.

cargo fmt --check, cargo clippy -p ed-acp-tauri --all-targets -- -D warnings and cargo test -p ed-acp-tauri pass. I did not run an external agent from this crate directly; sigit-app (getsigit/sigit-app#164) drives it.

A release bump to 1.3.6 follows once this and the ed-claude PR are merged.

AgentState::external starts a child process that speaks ACP, such as
Anthropic's claude through claude-agent-acp, and serves it with the same
client as the in-process agent: session updates, permission prompts,
fs/* inside the session roots and URL elicitation. The child is killed
when the connection ends, on logout or when the state is dropped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@setoelkahfi setoelkahfi self-assigned this Nov 1, 2026

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds an external-agent mode to AgentState. The host config is split into Common (client info, roots, MCP servers, events hooks) and a Source enum: InProcess keeps the old Profile + surface pair, External carries the new public ExternalConfig (command, args, env, client name/version). connect now builds either the in-memory Channel pair for ed_acp::serve or an AcpAgent child process over stdio, and the initialize/stay-connected logic is extracted into run_session, shared by both transports. logout short-circuits for external agents: it drops the live connection (which hangs up the session, ends connect_with, and drops the process transport, killing the child) and clears pending permission prompts. The in-process path is behaviorally unchanged apart from the refactor. Worth a first look at the external logout branch and the kill-on-drop chain it relies on; the rest is a faithful extraction of the old closure.


Automated review by siGit Code Review · commit 6e503e4 · see the review dashboard

Comment thread crates/ed-acp-tauri/src/client.rs Resolved
The doc promised the agent forgets its session. For an external agent
logout only ends the child process; the CLI keeps its credentials.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: siGit Code v1.7.6 <noreply@sigit.si>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of the doc-only follow-up. The previously flagged inaccurate logout doc on AgentState is now fixed: lines 682-684 correctly state that the in-process agent forgets its stored session while an external agent only has its child process ended and keeps its own credentials, matching the implementation comment at line 686. No other code changed since the last review, so the remaining open threads stand as before. Nothing new to report.


Automated review by siGit Code Review · commit 8b6a6ba · changes since 6e503e4 · see the review dashboard

@setoelkahfi
setoelkahfi merged commit 91094d5 into main Nov 2, 2026
1 check passed
@setoelkahfi
setoelkahfi deleted the feature/acp-external-agent branch November 2, 2026 09:39
@setoelkahfi setoelkahfi mentioned this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants