fix(acp): emit flush after non-LLM slash commands to unblock session/prompt#1689
Merged
fix(acp): emit flush after non-LLM slash commands to unblock session/prompt#1689
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
process_user_message()andhandle_image_command()now callself.channel.flush_chunks().awaitbefore returning, emittingLoopbackEvent::Flushto the ACP drain loopcrates/zeph-acp/src/agent/tests.rsusingtokio::time::timeout(5s)to assert slash command turns complete without hangingRoot cause
After #1679, slash commands are forwarded to the agent loop via
input_tx. Commands that skip LLM calls returnedOk(())without flushing, leaving the ACPhandle_prompt()drain loop (which breaks only onFlushor channel-close) blocked indefinitely.Affected commands (fixed)
/graph,/status,/plan list/status/cancel/resume/retry,/skills,/compact,/feedback,/mcp,/scheduler,/agent,/lsp,/experiment,/imageTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 5284 passednon_llm_slash_command_prompt_completes_with_flush,non_llm_slash_commands_all_complete_without_hangingCloses #1683