Skip to content

zeph-acp: /review slash command bypasses acquire_prompt_channels, its output is now silently dropped #6673

Description

@bug-ops

Description

Found during adversarial review of PR #6672 (fix for #6666/#6667).

handle_review_command (crates/zeph-acp/src/agent/slash.rs:143-170) dispatches its prompt via input_tx.try_send and returns EndTurn immediately, without ever calling acquire_prompt_channels/acquiring output_rx. It is dispatched at turn.rs:385-389, i.e. before the normal acquire-and-drain turn path.

Before PR #6672, the agent-loop events produced by this fire-and-forget /review prompt would leak into the next real session/prompt call and get consumed by its drain_agent_events, corrupting that unrelated turn — this is very likely the actual real-world trigger for #6667, more so than the abort-mid-drain scenario the issue was originally framed around.

After PR #6672's fix, acquire_prompt_channels now drains any queued events at acquire time, so /review's output is instead silently discarded rather than leaking into the next turn. This is a net improvement (no more turn corruption), but /review is now effectively a no-op from the operator's perspective — its output goes nowhere.

Expected Behavior

/review should either:

  • Go through the normal acquire_prompt_channels/drain turn path so its output is actually delivered to the client, or
  • Stop pretending to be a fire-and-forget prompt turn (e.g. dispatch synchronously and stream results back some other way).

Suggested Fix Direction

Route /review's dispatch through the same acquire+drain turn machinery used by normal prompts, or use a distinct mechanism if it's meant to be async/detached (e.g. send_notification, the same pattern already used by /clear).

Environment

  • Introduced (or exposed): the underlying gap predates PR fix(acp): close PromptChannelGuard reload race and stale-event leak #6672's fix; that PR's drain in acquire_prompt_channels changed the failure mode from "corrupts the next turn" to "silently discarded" but did not fix the root cause.
  • Files: crates/zeph-acp/src/agent/slash.rs (handle_review_command, lines 143-170), crates/zeph-acp/src/agent/turn.rs (do_prompt dispatch at lines 385-389, acquire_prompt_channels)

Logs / Evidence

Found during independent adversarial critique of PR #6672 (finding N1). See PR #6672 review discussion for the full analysis.

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions