Problem
After PR #1679, all slash commands except the 5 ACP-native ones (/help, /mode, /clear, /review, /model) are forwarded to the agent loop via input_tx. This is correct — but certain slash commands that are processed without an LLM call (e.g. /graph, /status, /compact, /plan list) cause session/prompt to hang indefinitely.
Root Cause
The ACP handle_prompt() drain loop at mod.rs:1107 waits for a LoopbackEvent::Stop event or channel close on output_rx. When the agent loop processes a slash command that produces output via the channel's send() method but does NOT invoke an LLM call, the Stop event is never emitted and the output_rx channel is never closed during that turn.
Result: session/prompt never returns a response — the client gets a timeout.
Evidence
Live test with /status prompt:
- ACP log: agent starts, debug dump directory created (turn started)
- Debug dump: empty (no LLM calls — slash command processed directly)
session/prompt response: timeout after 45s
- Same behavior for
/graph
Affected Commands
Any agent-loop slash command that does not trigger a full LLM turn:
/graph — graph stats (direct output, no LLM)
/status — session status (direct output, no LLM)
/compact — compaction (may not trigger LLM)
/plan list, /plan status — plan status (direct output)
/skills — skill list (direct output)
/clear — already ACP-native, correctly handled
Fix Sketch
Ensure that every agent loop turn — including slash-command-only turns — emits a terminal event on output_rx (a LoopbackEvent::Stop or channel-close) when the turn completes. This should be guaranteed by the runner's turn-completion logic regardless of whether an LLM call was made.
Problem
After PR #1679, all slash commands except the 5 ACP-native ones (
/help,/mode,/clear,/review,/model) are forwarded to the agent loop viainput_tx. This is correct — but certain slash commands that are processed without an LLM call (e.g./graph,/status,/compact,/plan list) causesession/promptto hang indefinitely.Root Cause
The ACP
handle_prompt()drain loop atmod.rs:1107waits for aLoopbackEvent::Stopevent or channel close onoutput_rx. When the agent loop processes a slash command that produces output via the channel'ssend()method but does NOT invoke an LLM call, theStopevent is never emitted and theoutput_rxchannel is never closed during that turn.Result:
session/promptnever returns a response — the client gets a timeout.Evidence
Live test with
/statusprompt:session/promptresponse: timeout after 45s/graphAffected Commands
Any agent-loop slash command that does not trigger a full LLM turn:
/graph— graph stats (direct output, no LLM)/status— session status (direct output, no LLM)/compact— compaction (may not trigger LLM)/plan list,/plan status— plan status (direct output)/skills— skill list (direct output)/clear— already ACP-native, correctly handledFix Sketch
Ensure that every agent loop turn — including slash-command-only turns — emits a terminal event on
output_rx(aLoopbackEvent::Stopor channel-close) when the turn completes. This should be guaranteed by the runner's turn-completion logic regardless of whether an LLM call was made.