# agent_servers: Extract ACP stdio construction \(\#64598\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/674dd790c5123805cd315d42610368e23fe2b1a7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 674dd790c5123805cd315d42610368e23fe2b1a7

Requested commit: 674dd790c5123805cd315d42610368e23fe2b1a7

Commit: 674dd790c5123805cd315d42610368e23fe2b1a7

Tree: 3569c3e23213c800d73a9fc4d85e7446e5c6b6a6

Author: Ben Brandt

Committer: GitHub

## Message

```
agent_servers: Extract ACP stdio construction (#64598)

Extract ACP process/stdio construction so it can be reused independently
of protocol initialization, while keeping the existing v1 connection
behavior unchanged.

- Move command resolution, environment/CWD handling, pipe creation, line
framing, and debug taps into a private `spawn_stdio` factory.
- Keep task startup, child-process ownership, initialization,
authentication fallback, and shutdown in `AcpConnection`. The factory
returns an unpolled stderr future rather than starting another task.
- Move the existing debug log and its tests into a dedicated module,
preserving public message types, reexports, parsing, and subscription
behavior.
- Add a bounded real-process regression covering repeated fresh spawns,
environment/CWD, newline framing, incoming/outgoing debug capture, and
stderr trimming.

This does not add automatic restart, protocol negotiation, or new
shutdown/drain behavior. The larger diff is primarily relocation of
existing code and tests.

Release Notes:

- N/A
```

## Parents

- [189839eef500a5ab5edbcf97cbea2279f11b9d79](https://git.cafe/gitcafe/zed/commit/189839eef500a5ab5edbcf97cbea2279f11b9d79?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/674dd790c5123805cd315d42610368e23fe2b1a7?format=markdown)
