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
674dd790c5Ben Brandt committed on 9/22/2026, 1:45:40 PM· committed by GitHubparent189839e
3 files changedLine totals unavailable