Skip to content

fix(acp): emit flush after non-LLM slash commands to unblock session/prompt#1689

Merged
bug-ops merged 2 commits intomainfrom
acp-slash-cmd-no-llm-hang
Mar 13, 2026
Merged

fix(acp): emit flush after non-LLM slash commands to unblock session/prompt#1689
bug-ops merged 2 commits intomainfrom
acp-slash-cmd-no-llm-hang

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 13, 2026

Summary

  • All non-LLM slash command branches in process_user_message() and handle_image_command() now call self.channel.flush_chunks().await before returning, emitting LoopbackEvent::Flush to the ACP drain loop
  • Two regression tests added in crates/zeph-acp/src/agent/tests.rs using tokio::time::timeout(5s) to assert slash command turns complete without hanging

Root cause

After #1679, slash commands are forwarded to the agent loop via input_tx. Commands that skip LLM calls returned Ok(()) without flushing, leaving the ACP handle_prompt() drain loop (which breaks only on Flush or channel-close) blocked indefinitely.

Affected commands (fixed)

/graph, /status, /plan list/status/cancel/resume/retry, /skills, /compact, /feedback, /mcp, /scheduler, /agent, /lsp, /experiment, /image

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features full -- -D warnings — clean
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 5284 passed
  • Regression tests: non_llm_slash_command_prompt_completes_with_flush, non_llm_slash_commands_all_complete_without_hanging

Closes #1683

bug-ops added 2 commits March 13, 2026 22:10
…prompt

Slash commands that bypass LLM calls (e.g. /graph, /status, /plan list,
/skills, /compact) returned without calling flush_chunks(), so the ACP
drain loop in handle_prompt() never received LoopbackEvent::Flush and
hung indefinitely.

Add flush_chunks() before every return in the non-LLM branches of
process_user_message() and handle_image_command() so the drain loop
always receives a termination signal regardless of whether an LLM call
was made.

Adds two regression tests in zeph-acp using tokio::time::timeout to
assert that slash command turns complete within 5 s.

Closes #1683
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 13, 2026 21:15
@bug-ops bug-ops merged commit 614e385 into main Mar 13, 2026
15 checks passed
@bug-ops bug-ops deleted the acp-slash-cmd-no-llm-hang branch March 13, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant