crates/tui/src/acp_server.rs is a second turn loop, prompt authority and conversation store
- Dominant language
- Rust
- Stars
- 41k
- Forks
- 3.6k
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 299
Description
Recorded from the 2026-09-07 architecture sweep (`codewhale-ops/FINDINGS-20260907-REFS-STUDY-AND-DEFECTS.md` §2.1) so it stops being invisible; re-verified by grep 2026-09-11 at `89621d5a5`.
## What the source shows
- `crates/tui/src/acp_server.rs:69` — `const MAX_ACP_TOOL_ROUNDS: usize = 50;`
- `run_agentic_prompt_turn` (`:1286`) runs its own `for _round in 0..MAX_ACP_TOOL_ROUNDS` loop (`:1305`) with its own stream driver (`drive_prompt_stream`, `:444`), its own tool executor and its own stop reasons.
- It opens the provider directly (`LlmClient::create_message_stream`) rather than through the engine.
- It freezes its own system prompt and keeps its own conversation store (`AcpSession.messages`) with its own commit/rollback (as recorded by the sweep).
- `Engine::run_turn` is in the same crate (`core/engine/turn_loop.rs`), so this is not a layering constraint.
## Why it matters
AGENTS.md: "A second turn loop, a second event authority, or a second prompt authority anywhere in the stack is the thing this product exists to not be."
## Ask
A named owner plus a slice, or an explicit recorded decision that ACP keeps its own loop. Related: Core plan C07/C08 (converge execution / one runtime host); #5969 fixed the schema half of ACP.
## Notes
Claims re-verify at claim time; line numbers are from `89621d5a5`.
Contributor guide
Research direction
Read crates/tui/src/acp_server.rs, especially run_agentic_prompt_turn, drive_prompt_stream, AcpSession.messages, and MAX_ACP_TOOL_ROUNDS, then compare them with core/engine/turn_loop.rs and Engine::run_turn. Done means an owner and implementation slice are recorded for convergence, or an explicit decision documents why ACP keeps its own loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100