Skip to content

bug(acp): session/prompt hangs for non-LLM slash commands after agent-loop pass-through #1683

@bug-ops

Description

@bug-ops

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingllmzeph-llm crate (Ollama, Claude)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions