Skip to content

fix(acp): all agent-loop slash commands broken in ACP sessions (plan, graph, status, etc.) #1672

@bug-ops

Description

@bug-ops

Problem

The ACP handle_prompt() method in crates/zeph-acp/src/agent/mod.rs intercepts all unknown slash commands and returns an "unknown command" error to the ACP client, instead of passing them to the agent loop.

Root Cause

The current logic routes any /-prefixed input through handle_slash_command() unless it appears in a small hard-coded pass-through list. This means the agent loop never receives these commands in ACP sessions.

Affected Commands

All agent-loop commands are broken in ACP sessions, including:

  • /plan, /graph, /status, /skills, /mcp
  • /image, /log, /agent, /feedback, /skill
  • /debug-dump, /compact (and any future agent-loop commands)

Currently only /compact, /model refresh, /scheduler, and /scheduler <subcommand> are correctly passed through.

Recommended Fix

Invert the logic to an allowlist approach: only intercept the 5 ACP-native commands that handle_slash_command() actually handles — /help, /model, /mode, /clear, /review — and pass everything else through to the agent loop unchanged.

let trimmed_text = text.trim_start();
if trimmed_text.starts_with('/') {
    let is_acp_native = trimmed_text == "/help"
        || trimmed_text == "/mode"
        || trimmed_text.starts_with("/mode ")
        || trimmed_text == "/clear"
        || trimmed_text.starts_with("/review")
        || trimmed_text == "/model"
        || trimmed_text.starts_with("/model ");
    if is_acp_native {
        return self
            .handle_slash_command(&args.session_id, trimmed_text)
            .await;
    }
}

This is more robust: new agent-loop commands work automatically in ACP without requiring changes to the pass-through list.

Related

Fixes partial regression introduced alongside #1658 fix (adding /scheduler to the denylist). The denylist pattern is the root problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions