Skip to content

! shell commands in TUI always fail with [rpc -32601] method_not_found (backend never registers command.dispatch) #171

Description

@silverLXT

Summary

In raven tui, any input prefixed with ! (bang shell escape) fails with:

error: [rpc -32601] method_not_found

This happens for every bang command (!ls, !clear, !pwd, …) — it is not command-specific. The ! feature is effectively unusable in v0.1.6.

Environment

  • Raven: v0.1.6 (installed via install.sh → uv tool)
  • OS: macOS 15.6 (arm64, Apple Silicon)
  • Channel: tui

Steps to reproduce

  1. raven tui
  2. Type !ls and press enter
  3. Observe: error: [rpc -32601] method_not_found

Expected

The !ls shell command runs and its output is shown.

Actual

JSON-RPC error -32601 method_not_found.

Root cause

The frontend routes bang commands to an RPC method named command.dispatch, but the backend never registers it, so the dispatcher returns -32601.

Evidence:

  • Frontend (raven/ui-tui/dist/entry.js) calls it:
    gw.request("command.dispatch", { name, arg, session_id }).then((raw) => {
      const d = asCommandDispatch(raw); // expects { type: "exec"|"plugin"|"alias", output?, target? }
      ...
    })
  • Backend confirms it is unregistered — raven/tui_rpc/methods/slash_routing.py:12:
    ... the .catch() branch would fall through to
    ``command.dispatch`` which is also unregistered).
    
  • command.dispatch is absent from the umbrella registration in raven/tui_rpc/methods/__init__.py (register_aligned_methods_except_system).

Suggested fix

Add a register_command_methods() that registers command.dispatch and wire it into the umbrella in methods/__init__.py (same pattern as the existing register_slash_routing_methods). The handler should return the shape the frontend expects:

{ type: "exec" | "plugin" | "alias", output?: string, target?: string }

The existing slash.exec handler in slash_routing.py is a close template (shlex-split → delegate to executor → shape result → never raise -32xxx). Consider routing the exec path through the same executor the agent uses (build_executor()), so bang commands also respect tools.sandbox.backend.

Workaround

Ask the agent in natural language (e.g. "run ls") — that goes through the agent's exec tool and works. Use /-slash commands or Ctrl+L instead of !clear.

Activity

  1. 0xKT commented on Oct 9, 2026

    @0xKT
    Member

    Fixed on main by commit 4c2f1ef (fix(*): back the nine rpc methods ui-tui calls), first released in v0.2.0. The backend now registers shell.exec, which is the method the TUI actually calls for ! lines and {!cmd} interpolation (raven/rpc/methods/shell.py), and also the command.dispatch slash fallback; both are wired into the umbrella registration that raven tui uses. A ! command now runs through the session's own executor, so a configured sandbox still applies, and its stdout, stderr and exit code are shown instead of -32601. If you still see method_not_found on 0.2.x, please reopen with the output of raven --version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions