The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(acp): registry commands the editor path does not serve get a named reply, not Internal error
Teknium69f80031dee9
diff --git a/acp_adapter/gateway_commands.py b/acp_adapter/gateway_commands.pyindex ea260aabb60..7ada3a56067 100644--- a/acp_adapter/gateway_commands.py+++ b/acp_adapter/gateway_commands.py@@ -3,7 +3,11 @@Main served these in-process (``acp_adapter/commands.py``). The reports are the owner's own``slash.exec`` reads, ``/model``, ``/compress`` and ``/reset`` the retained ``session.mutate``controls, ``/steer`` the owner's ``session.steer``; ``/queue`` and an idle ``/steer`` become the-next prompt, which the session's FIFO runs after any turn in flight.+next prompt, which the session's FIFO runs after any turn in flight. ``/title <name>`` is the+``rename`` mutation and ``/undo`` / ``/retry`` the ``rewind`` one, as in the classic transport+client (``hermes_cli/gateway_chat_commands.py``). Every other registry command goes to the owner's+``slash.exec`` like there: it runs what it serves for this session and refuses the rest, and that+refusal reaches the editor as a reply naming the command, never a failed prompt."""from __future__ import annotations@@ -11,19 +15,23 @@ from hermes_cli.gateway_client import GatewayClientError, GatewayRPCError# Reports the owner answers for a local session (``gateway/session_commands.py::_READ_COMMANDS``)._READS = frozenset({'context', 'usage', 'status', 'version'})-_MUTATIONS = frozenset({'model', 'compress', 'new', 'branch'})+# ``/clear`` is main's "new session + clear screen"; here it is ``/new``'s reset of this session.+_MUTATIONS = frozenset({'model', 'compress', 'new', 'clear', 'branch'})_PROMPTS = frozenset({'steer', 'queue'})-COMMANDS = _READS | _MUTATIONS | _PROMPTS | {'help', 'tools'}+_REWINDS = frozenset({'undo', 'retry'})+COMMANDS = _READS | _MUTATIONS | _PROMPTS | _REWINDS | {'help', 'tools', 'title'}+++class CommandRefused(GatewayClientError):+ """A refusal the editor shows as the command's reply (the prompt itself ends normally)."""async def run_command(agent, session_id, command, arg):"""``(reply, None)`` for a command answered here, or ``(None, text)`` when ``text`` is to be- submitted as the prompt. Unsupported commands are refused before any gateway call."""+ submitted as the prompt. A refusal raises ``CommandRefused`` (or the owner's RPC error)."""from acp_adapter.gateway_session_meta import help_text- if command not in COMMANDS:- raise GatewayClientError('unsupported_command')if command == 'branch':- raise GatewayClientError('use_acp_fork_session')+ raise CommandRefused("/branch: use your editor's fork session action (ACP session/fork)")if command == 'help':return help_text(), Noneif command in _PROMPTS:@@ -32,15 +40,75 @@ async def run_command(agent, session_id, command, arg):steered = await _steer(agent, session_id, arg) if command == 'steer' else Nonereturn (steered, None) if steered else (None, arg)client = await agent._client()- if command in _READS:- result = await client.rpc('slash.exec', session_id=session_id, command=f'/{command} {arg}'.strip())- return str(result.get('output') or result.get('notice') or ''), None+ if command not in COMMANDS or command in _READS or (command == 'title' and not arg):+ return await _forward(agent, client, session_id, command, arg)+ if command == 'title':+ return await _rename(agent, client, session_id, arg), None+ if command in _REWINDS:+ return await _rewind(agent, client, session_id, command, arg)if command == 'tools' or (command == 'model' and not arg):info = await client.rpc('session.info', session_id=session_id)return (_tools_text(info) if command == 'tools' else _model_text('Current model', info)), Nonereturn await _mutate(agent, client, session_id, command, arg), None+async def _forward(agent, client, session_id, command, arg):+ """The owner's ``slash.exec`` answer: its report, a turn to submit (a skill body or the turn a+ command built, after its notice), or the shared refusal for a command it does not serve."""+ import acp+ from hermes_cli.gateway_chat_commands import refusal+ try:+ reply = await client.rpc('slash.exec', session_id=session_id, command=f'/{command} {arg}'.strip())+ except GatewayRPCError as exc:+ if str(exc) != 'unsupported_command':+ raise+ raise CommandRefused(refusal(command)) from exc+ if reply.get('type') in ('skill', 'send'):+ if reply.get('notice') and agent._conn:+ await agent._conn.session_update(session_id=agent._editor_id(session_id),+ update=acp.update_agent_message_text(reply['notice'] + '\n'))+ return None, reply['message']+ return str(reply.get('output') or reply.get('notice') or f'/{command}: no output'), None+++async def _rename(agent, client, session_id, title):+ payload = {'title': title}+ result = await agent._mutations.apply(client, session_id, 'rename', payload)+ agent._mutations.acknowledge(session_id, 'rename', payload)+ return f"Session title set: {result.get('title') or title}"+++async def _rewind(agent, client, session_id, command, arg):+ """``/undo [N]`` reports the removed message (an editor has no composer to put it back in);+ ``/retry`` resubmits the last user turn's lossless text as this prompt."""+ from agent.i18n import t+ from hermes_cli.gateway_chat_commands import _rewind_to+ retry = command == 'retry'+ if not retry and arg and not (arg.isdigit() and int(arg) > 0):+ raise CommandRefused('Usage: /undo [N]')+ turns = 1 if retry else int(arg or 1)+ payload = _rewind_to(turns, retry=retry)+ result = await agent._mutations.apply(client, session_id, 'rewind', payload)+ agent._mutations.acknowledge(session_id, 'rewind', payload)+ if result.get('status') == 'nothing' or not result.get('rewound_count'):+ return t('cli.session.retry_no_user_message' if retry else 'cli.session.undo_no_user_message'), None+ agent._snapshots[session_id] = await client.rpc('session.resume', session_id=session_id)+ content = (result.get('target_message') or {}).get('content')+ if retry:+ from agent.context_compressor import retryable_user_text+ try:+ text = retryable_user_text(content)+ except ValueError as exc:+ raise CommandRefused(f'/retry: {exc}') from exc+ if not text.strip():+ return t('cli.session.retry_no_user_message'), None+ return None, text+ removed = content if isinstance(content, str) else ''+ count = result['rewound_count']+ return (f"Undid {turns} turn{'s' if turns != 1 else ''} ({count} message(s)).\n"+ + (f"Removed message: {removed}" if removed else '')).rstrip(), None++async def _steer(agent, session_id, text):"""Guidance for this editor's running turn; None when there is none to steer (main ran an idlesteer as a plain prompt, and a turn that ended meanwhile leaves the text for the next one).@@ -70,7 +138,7 @@ async def _steer(agent, session_id, text):async def _mutate(agent, client, session_id, command, arg):from hermes_cli.gateway_mutations import slash_mutation- operation, payload = ('reset', {}) if command == 'new' else slash_mutation('/' + command, arg)+ operation, payload = ('reset', {}) if command in {'new', 'clear'} else slash_mutation('/' + command, arg)confirm = agent._model_confirmer(session_id) if operation == 'model' else Noneresult = await agent._mutations.apply(client, session_id, operation, payload, confirm=confirm)status = result.get('status')diff --git a/acp_adapter/gateway_server.py b/acp_adapter/gateway_server.pyindex 94c3e59e3aa..f1075b94aec 100644--- a/acp_adapter/gateway_server.py+++ b/acp_adapter/gateway_server.py@@ -27,8 +27,8 @@ def _slash_command(text):Only a registered command (or alias) is a command: ``/etc/hosts is wrong`` or ``/tmp/x``(a path, the same rule ``MessageEvent.get_command`` applies) and unknown ``/words`` are- prompt text for the model. A registered command this surface does not carry still raises- ``unsupported_command`` in ``slash_mutation`` rather than reaching the owner as text."""+ prompt text for the model. A registered command is never sent as prompt text: it is answered+ by a gateway verb or refused by name (``acp_adapter/gateway_commands.py``)."""stripped = text.lstrip()if not stripped.startswith('/'):return None@@ -527,9 +527,13 @@ class GatewayACPAgent(GatewayReplyMixin, acp.Agent):text, attachments = stagedcommand = _slash_command(text) if not attachments else Noneif command is not None:- from acp_adapter.gateway_commands import run_command+ from acp_adapter.gateway_commands import CommandRefused, run_commandparts = text.strip().split(None, 1)- reply, text = await run_command(self, session_id, command, parts[1].strip() if len(parts) > 1 else '')+ try:+ reply, text = await run_command(self, session_id, command, parts[1].strip() if len(parts) > 1 else '')+ except CommandRefused as exc:+ # A named refusal is the command's answer, shown to the user; never a failed prompt.+ reply = str(exc)if reply is not None:if self._conn:await self._conn.session_update(session_id=held_id, update=acp.update_agent_message_text(reply + '\n'))diff --git a/acp_adapter/gateway_session_meta.py b/acp_adapter/gateway_session_meta.pyindex b6caa52c32f..fa49b6f0955 100644--- a/acp_adapter/gateway_session_meta.py+++ b/acp_adapter/gateway_session_meta.py@@ -38,6 +38,9 @@ COMMANDS: dict[str, tuple[str, str | None]] = {"usage": ("Show token usage and rate limits", None),"status": ("Show session, model, token, and context info", None),"version": ("Show Hermes version", None),+ "title": ("Show or set the session title", "new title"),+ "undo": ("Remove the last N user turns and their replies", "number of turns"),+ "retry": ("Resend the last user message", None),}@@ -51,7 +54,8 @@ def available_commands_update() -> AvailableCommandsUpdate:def help_text() -> str:lines = ["Available commands:", ""]lines.extend(f" /{name:10s} {description}" for name, (description, _hint) in COMMANDS.items())- lines.extend(["", "Unrecognized /commands are sent to the model as normal messages."])+ lines.extend(["", "Other Hermes commands run on the gateway, which answers them or says why not.",+ "Unrecognized /commands are sent to the model as normal messages."])return "\n".join(lines)diff --git a/scripts/gen_gateway_command_parity.py b/scripts/gen_gateway_command_parity.pyindex 4f3a9d66446..6bee4c5409a 100755--- a/scripts/gen_gateway_command_parity.py+++ b/scripts/gen_gateway_command_parity.py@@ -4,7 +4,7 @@For every ``COMMAND_REGISTRY`` command it records what each local client does with it on theshared gateway -- the classic CLI (main's ``HermesCLI`` dispatch table, ``cli.py``), Ink(``ui-tui/src/app/slash/commands/*.ts``), Desktop (``apps/desktop/src/lib/desktop-slash-commands.ts``-+ the registry's ``desktop=`` dump), ACP (``acp_adapter`` -> ``slash_mutation``) -- and the++ the registry's ``desktop=`` dump), ACP (``acp_adapter/gateway_commands.py``) -- and thegateway's own ``slash.exec`` verdict for a local session (``gateway/session_commands.py``).Every column is derived from source, so a verdict that changes without a regenerated tablefails ``tests/hermes_cli/test_gateway_command_parity.py``. ``--check`` writes nothing and exits 1@@ -95,14 +95,24 @@ def classic_cell(cmd):return f"HermesCLI.{entry[0]}"+# Commands ACP answers with its own canonical verb (``acp_adapter/gateway_commands.py``); every+# other registry command goes to the owner's ``slash.exec`` and shows its refusal as the reply.+ACP_ROUTES = {"branch": "ACP fork_session", "title": "session.mutate rename (bare: slash.exec)",+ "undo": "session.mutate rewind", "retry": "session.mutate rewind + resubmit",+ "new": "session.mutate reset", "clear": "session.mutate reset", "help": "local",+ "tools": "session.info", "steer": "session.steer", "queue": "prompt.submit"}++def acp_cell(name, gateway):from hermes_cli.gateway_client import GatewayClientErrorfrom hermes_cli.gateway_mutations import slash_mutation+ if name in ACP_ROUTES:+ return ACP_ROUTES[name]try:operation, _ = slash_mutation("/" + name, "x" if name == "model" else "")except GatewayClientError:- return "refused"- return "ACP fork_session" if operation == "branch" else f"session.mutate {operation}"+ return "slash.exec" if gateway != "refused" else "slash.exec: refused"+ return f"session.mutate {operation}"def _ink_commands():diff --git a/tests/acp_adapter/test_gateway_registry_commands.py b/tests/acp_adapter/test_gateway_registry_commands.pynew file mode 100644index 00000000000..f39465c25fb--- /dev/null+++ b/tests/acp_adapter/test_gateway_registry_commands.py@@ -0,0 +1,62 @@+"""Registry commands ACP does not answer itself, over the real ACP stdio wire and a real gateway.++Every registered Hermes command typed in an editor ends the prompt with a reply the user reads:+the owner's own answer (``slash.exec``, ``session.mutate``) or a named refusal. None of them may+fail the JSON-RPC request with ``Internal error`` (#134889 ACP-17).+"""+import json++import pytest++from tests.acp_adapter.test_gateway_sessions import editor, viewer+++def _replies(frames, start):+ return "".join(f["params"]["update"]["content"]["text"] for f in frames[start:]+ if f.get("method") == "session/update"+ and f["params"]["update"].get("sessionUpdate") == "agent_message_chunk")++[email protected]("linux")+async def test_registered_commands_answer_or_refuse_by_name_never_internal_error(daemon, tmp_path, model_peer):+ async with viewer(daemon) as ws:+ sid = (await ws.rpc("session.create", request_id="acp-registry", source="cli", cwd=str(tmp_path)))["session_id"]+ async with editor(daemon, tmp_path) as acp:+ await acp.rpc("initialize", protocolVersion=1, clientCapabilities={})+ assert "result" in await acp.rpc("session/load", cwd=str(tmp_path), sessionId=sid, mcpServers=[])+ replies = {}+ for text in ("/title Registry probe", "/title", "/yolo", "/skills", "/undo", "/retry", "/bg x",+ "/rollback", "/branch"):+ start = len(acp.frames)+ reply = await acp.rpc("session/prompt", sessionId=sid, prompt=[{"type": "text", "text": text}])+ assert "error" not in reply, (text, reply)+ assert reply["result"]["stopReason"] == "end_turn", (text, reply)+ replies[text] = _replies(acp.frames, start)+ assert replies[text].strip(), (text, acp.frames[start:])+ assert "Registry probe" in replies["/title Registry probe"], replies+ assert "Registry probe" in replies["/title"], replies+ assert "yolo" in replies["/yolo"].lower() or "YOLO" in replies["/yolo"], replies+ for refused in ("/bg x", "/rollback"):+ name = refused.split()[0]+ assert f"{name} is not available" in replies[refused], replies+ assert "fork" in replies["/branch"].lower(), replies+ # No model turn ran: every command was answered by the owner or refused.+ assert not model_peer.requests, model_peer.requests++ # /retry resends the last user turn as a new turn; /undo removes it and reports it.+ turn = await acp.rpc("session/prompt", sessionId=sid,+ prompt=[{"type": "text", "text": "WS_SHARED rewind me"}])+ assert turn["result"]["stopReason"] == "end_turn", turn+ retried = await acp.rpc("session/prompt", sessionId=sid, prompt=[{"type": "text", "text": "/retry"}])+ assert retried["result"]["stopReason"] == "end_turn", retried+ assert len(model_peer.requests) == 2, model_peer.requests+ start = len(acp.frames)+ undone = await acp.rpc("session/prompt", sessionId=sid, prompt=[{"type": "text", "text": "/undo"}])+ assert undone["result"]["stopReason"] == "end_turn", undone+ assert "Removed message: WS_SHARED rewind me" in _replies(acp.frames, start), acp.frames[start:]+ info = await ws.rpc("session.info", session_id=sid)+ assert info.get("title") == "Registry probe", info+ messages = json.dumps((await ws.rpc("session.resume", session_id=sid))["messages"])+ assert "WS_SHARED rewind me" not in messages, messages+ print("ACP_REGISTRY_COMMANDS=" + json.dumps(replies))diff --git a/tests/acp_adapter/test_gateway_slash_text.py b/tests/acp_adapter/test_gateway_slash_text.pyindex 4a28d1a27b4..eef02cfdbf8 100644--- a/tests/acp_adapter/test_gateway_slash_text.py+++ b/tests/acp_adapter/test_gateway_slash_text.py@@ -29,11 +29,22 @@ async def test_path_and_unknown_slash_text_is_submitted_as_the_prompt(text):@pytest.mark.asyncio-async def test_registered_command_this_surface_does_not_carry_is_still_refused_locally():- # A Hermes command is never forwarded as text the owner might execute as a control.+async def test_registered_command_the_owner_refuses_is_a_named_reply_not_a_failed_prompt():+ # A Hermes command is never forwarded as prompt text: the owner's slash.exec answers or+ # refuses it, and the refusal is the command's reply (#134889 ACP-17).+ from hermes_cli.gateway_client import GatewayRPCErroragent = GatewayACPAgent()- agent._gateway = AsyncMock()+ agent._gateway, agent._conn = AsyncMock(), AsyncMock()agent._snapshots["s"] = {}- with pytest.raises(GatewayClientError, match="unsupported_command"):- await agent.prompt([acp.text_block("/rollback")], "s")- agent._gateway.rpc.assert_not_awaited()+ calls = []++ async def rpc(method, **params):+ calls.append((method, params))+ raise GatewayRPCError("unsupported_command")++ agent._gateway.rpc.side_effect = rpc+ response = await agent.prompt([acp.text_block("/rollback")], "s")+ assert response.stop_reason == "end_turn"+ assert calls == [("slash.exec", {"session_id": "s", "command": "/rollback"})]+ shown = agent._conn.session_update.await_args.kwargs["update"].content.text+ assert "/rollback is not available on the shared gateway" in showndiff --git a/website/docs/developer-guide/gateway-command-parity.md b/website/docs/developer-guide/gateway-command-parity.mdindex 1266472871a..61766989284 100644--- a/website/docs/developer-guide/gateway-command-parity.md+++ b/website/docs/developer-guide/gateway-command-parity.md@@ -30,106 +30,106 @@ handler does; `client-local (cli_only)` commands are terminal/UI features of a c| Command | Gateway (`slash.exec`) | Classic CLI | Ink | Desktop | ACP | Notes ||---|---|---|---|---|---|---|-| `/agents` (/tasks) | refused | HermesCLI._handle_agents_command | delegation.pause | slash.exec: refused | refused | gateway-wide: lists every chat's running agents and the process's async jobs |-| `/approvals` | control | HermesCLI._handle_approvals_command | slash.exec | slash.exec | refused | per-session setting (gateway handler) |-| `/approve` | control | messaging-only: unknown command | slash.exec | slash.exec | refused | messaging-only |-| `/autoprune` | control | HermesCLI._handle_autoprune_command | slash.exec | slash.exec | refused | |-| `/battery` | refused | HermesCLI._handle_battery_command | sidecar: system.battery (preference not saved) | slash.exec: refused | refused | client-local (cli_only) |-| `/bg` | refused | HermesCLI._handle_background_command | prompt.background | action: background | refused | |-| `/blueprint` (/bp) | control | HermesCLI._handle_blueprint_command | slash.exec | slash.exec | refused | |+| `/agents` (/tasks) | refused | HermesCLI._handle_agents_command | delegation.pause | slash.exec: refused | slash.exec: refused | gateway-wide: lists every chat's running agents and the process's async jobs |+| `/approvals` | control | HermesCLI._handle_approvals_command | slash.exec | slash.exec | slash.exec | per-session setting (gateway handler) |+| `/approve` | control | messaging-only: unknown command | slash.exec | slash.exec | slash.exec | messaging-only |+| `/autoprune` | control | HermesCLI._handle_autoprune_command | slash.exec | slash.exec | slash.exec | |+| `/battery` | refused | HermesCLI._handle_battery_command | sidecar: system.battery (preference not saved) | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/bg` | refused | HermesCLI._handle_background_command | prompt.background | action: background | slash.exec: refused | |+| `/blueprint` (/bp) | control | HermesCLI._handle_blueprint_command | slash.exec | slash.exec | slash.exec | || `/branch` (/fork) | refused | HermesCLI._handle_branch_command | canonical route | action: branch | ACP fork_session | |-| `/browser` | refused | HermesCLI._handle_browser_command | sidecar: browser.manage | action: browser | refused | client-local (cli_only) |-| `/btw` | refused | HermesCLI._handle_btw_command | prompt.btw | action: btw | refused | |-| `/bundles` | read | HermesCLI._handle_bundles_command | slash.exec | slash.exec | refused | |-| `/busy` | control | HermesCLI._handle_busy_command | canonical route | unavailable: terminal | refused | per-session setting (gateway handler) |-| `/clear` | refused | HermesCLI._cmd_clear | local | action: new | refused | client-local (cli_only) |-| `/codex-runtime` (/codex_runtime) | control | HermesCLI._handle_codex_runtime | slash.exec | slash.exec | refused | per-session setting (gateway handler) |-| `/commands` | read | messaging-only: unknown command | slash.exec | action: help | refused | messaging-only |+| `/browser` | refused | HermesCLI._handle_browser_command | sidecar: browser.manage | action: browser | slash.exec: refused | client-local (cli_only) |+| `/btw` | refused | HermesCLI._handle_btw_command | prompt.btw | action: btw | slash.exec: refused | |+| `/bundles` | read | HermesCLI._handle_bundles_command | slash.exec | slash.exec | slash.exec | |+| `/busy` | control | HermesCLI._handle_busy_command | canonical route | unavailable: terminal | slash.exec | per-session setting (gateway handler) |+| `/clear` | refused | HermesCLI._cmd_clear | local | action: new | session.mutate reset | client-local (cli_only) |+| `/codex-runtime` (/codex_runtime) | control | HermesCLI._handle_codex_runtime | slash.exec | slash.exec | slash.exec | per-session setting (gateway handler) |+| `/commands` | read | messaging-only: unknown command | slash.exec | action: help | slash.exec | messaging-only || `/compress` (/compact) | refused | HermesCLI._manual_compress | canonical route | action: compress | session.mutate compress | |-| `/config` | refused | HermesCLI.show_config | slash.exec: refused | unavailable: terminal | refused | client-local (cli_only) |-| `/context` (/ctx) | read | HermesCLI._show_context_breakdown | slash.exec | slash.exec | refused | TUI session: main's live /context with the category table |-| `/copy` | refused | HermesCLI._handle_copy_command | local | unavailable: terminal | refused | client-local (cli_only) |-| `/cron` | refused | HermesCLI._handle_cron_command | slash.exec | unavailable: terminal | refused | TUI session: bare `/cron` and `/cron list [--all]` read the profile's jobs; client-local (cli_only) |-| `/curator` | control | HermesCLI._handle_curator_command | slash.exec | unavailable: advanced | refused | |-| `/debug` | control | HermesCLI._handle_debug_command | slash.exec | slash.exec | refused | uploads logs to a public paste |-| `/deny` | control | messaging-only: unknown command | slash.exec | slash.exec | refused | messaging-only |-| `/diff` | read | HermesCLI._handle_diff_command | slash.exec | slash.exec | refused | |-| `/egress` | control | HermesCLI._cmd_egress | slash.exec | slash.exec | refused | |-| `/export` | refused | HermesCLI._handle_export_command | slash.exec: refused | slash.exec: refused | refused | client-local (cli_only) |-| `/fast` | control | HermesCLI._handle_fast_command | config.get, config.set | unavailable: advanced | refused | per-session setting (gateway handler) |-| `/focus` | refused | HermesCLI._handle_focus_command | local (preference not saved) | slash.exec: refused | refused | client-local (cli_only) |-| `/footer` | control | HermesCLI._handle_footer_command | slash.exec | unavailable: terminal | refused | per-session setting (gateway handler) |-| `/goal` | control | HermesCLI._handle_goal_command | slash.exec | slash.exec | refused | |-| `/handoff` | refused | HermesCLI._handle_handoff_command | slash.exec: refused | action: handoff | refused | client-local (cli_only) |-| `/hatch` (/generate-pet) | refused | HermesCLI._handle_hatch_command | slash.exec: refused | action: hatch | refused | client-local (cli_only) |-| `/heartbeat` (/hb) | control | HermesCLI._handle_heartbeat_command | slash.exec | slash.exec | refused | |-| `/help` | read | HermesCLI._cmd_help | local | action: help | refused | |-| `/history` | refused | HermesCLI.show_history | local | unavailable: terminal | refused | client-local (cli_only) |-| `/image` | refused | HermesCLI._handle_image_command | local | unavailable: terminal | refused | client-local (cli_only) |-| `/import` | refused | HermesCLI._handle_import_command | slash.exec: refused | slash.exec: refused | refused | client-local (cli_only) |-| `/indicator` | refused | HermesCLI._handle_indicator_command | config.get, config.set | unavailable: terminal | refused | client-local (cli_only) |-| `/init` | control | HermesCLI._handle_init_command | slash.exec | slash.exec | refused | |-| `/insights` | read | HermesCLI._show_insights | slash.exec | unavailable: advanced | refused | |-| `/journey` (/learning, /memory-graph) | refused | HermesCLI._handle_journey_command | local | action: journey | refused | client-local (cli_only) |-| `/kanban` | read (list/show/stats/assignees/context/runs/log/diagnostics) | HermesCLI._handle_kanban_command | slash.exec | unavailable: advanced | refused | |-| `/learn` | control | HermesCLI._handle_learn_command | slash.exec | slash.exec | refused | |-| `/login` | control | HermesCLI._handle_login_command | slash.exec | unavailable: settings | refused | |-| `/loop` (/proactive) | control | HermesCLI._handle_loop_command | slash.exec | slash.exec | refused | |-| `/memory` | read (bare / `pending`) | HermesCLI._handle_memory_command | slash.exec | slash.exec | refused | |-| `/moa` | control | HermesCLI._cmd_moa | slash.exec | slash.exec | refused | |+| `/config` | refused | HermesCLI.show_config | slash.exec: refused | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/context` (/ctx) | read | HermesCLI._show_context_breakdown | slash.exec | slash.exec | slash.exec | TUI session: main's live /context with the category table |+| `/copy` | refused | HermesCLI._handle_copy_command | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/cron` | refused | HermesCLI._handle_cron_command | slash.exec | unavailable: terminal | slash.exec: refused | TUI session: bare `/cron` and `/cron list [--all]` read the profile's jobs; client-local (cli_only) |+| `/curator` | control | HermesCLI._handle_curator_command | slash.exec | unavailable: advanced | slash.exec | |+| `/debug` | control | HermesCLI._handle_debug_command | slash.exec | slash.exec | slash.exec | uploads logs to a public paste |+| `/deny` | control | messaging-only: unknown command | slash.exec | slash.exec | slash.exec | messaging-only |+| `/diff` | read | HermesCLI._handle_diff_command | slash.exec | slash.exec | slash.exec | |+| `/egress` | control | HermesCLI._cmd_egress | slash.exec | slash.exec | slash.exec | |+| `/export` | refused | HermesCLI._handle_export_command | slash.exec: refused | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/fast` | control | HermesCLI._handle_fast_command | config.get, config.set | unavailable: advanced | slash.exec | per-session setting (gateway handler) |+| `/focus` | refused | HermesCLI._handle_focus_command | local (preference not saved) | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/footer` | control | HermesCLI._handle_footer_command | slash.exec | unavailable: terminal | slash.exec | per-session setting (gateway handler) |+| `/goal` | control | HermesCLI._handle_goal_command | slash.exec | slash.exec | slash.exec | |+| `/handoff` | refused | HermesCLI._handle_handoff_command | slash.exec: refused | action: handoff | slash.exec: refused | client-local (cli_only) |+| `/hatch` (/generate-pet) | refused | HermesCLI._handle_hatch_command | slash.exec: refused | action: hatch | slash.exec: refused | client-local (cli_only) |+| `/heartbeat` (/hb) | control | HermesCLI._handle_heartbeat_command | slash.exec | slash.exec | slash.exec | |+| `/help` | read | HermesCLI._cmd_help | local | action: help | local | |+| `/history` | refused | HermesCLI.show_history | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/image` | refused | HermesCLI._handle_image_command | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/import` | refused | HermesCLI._handle_import_command | slash.exec: refused | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/indicator` | refused | HermesCLI._handle_indicator_command | config.get, config.set | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/init` | control | HermesCLI._handle_init_command | slash.exec | slash.exec | slash.exec | |+| `/insights` | read | HermesCLI._show_insights | slash.exec | unavailable: advanced | slash.exec | |+| `/journey` (/learning, /memory-graph) | refused | HermesCLI._handle_journey_command | local | action: journey | slash.exec: refused | client-local (cli_only) |+| `/kanban` | read (list/show/stats/assignees/context/runs/log/diagnostics) | HermesCLI._handle_kanban_command | slash.exec | unavailable: advanced | slash.exec | |+| `/learn` | control | HermesCLI._handle_learn_command | slash.exec | slash.exec | slash.exec | |+| `/login` | control | HermesCLI._handle_login_command | slash.exec | unavailable: settings | slash.exec | |+| `/loop` (/proactive) | control | HermesCLI._handle_loop_command | slash.exec | slash.exec | slash.exec | |+| `/memory` | read (bare / `pending`) | HermesCLI._handle_memory_command | slash.exec | slash.exec | slash.exec | |+| `/moa` | control | HermesCLI._cmd_moa | slash.exec | slash.exec | slash.exec | || `/model` | refused | HermesCLI._handle_model_switch | canonical route | picker: model | session.mutate model | |-| `/new` (/reset) | refused | HermesCLI._cmd_new | local | action: new | refused | |-| `/palette` | refused | HermesCLI._open_command_palette | slash.exec: refused | slash.exec: refused | refused | client-local (cli_only) |-| `/paste` | refused | HermesCLI._handle_paste_command | local | unavailable: terminal | refused | client-local (cli_only) |-| `/pause` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | refused | messaging-only |-| `/personality` | control | HermesCLI._handle_personality_command | canonical route | slash.exec | refused | per-session setting (gateway handler) |-| `/pet` | refused | HermesCLI._handle_pet_command | slash.exec | action: pet | refused | client-local (cli_only) |-| `/plan` | control | HermesCLI._handle_plan_command | slash.exec | slash.exec | refused | |-| `/platform` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | refused | messaging adapters; `pause`/`resume` mutate them |-| `/platforms` (/gateway) | read | HermesCLI._show_gateway_status | slash.exec | unavailable: terminal | refused | client-local (cli_only) |-| `/plugins` | refused | HermesCLI._cmd_plugins | slash.exec | unavailable: terminal | refused | client-local (cli_only) |-| `/profile` | read | HermesCLI._handle_profile_command | slash.exec | action: profile | refused | |-| `/prompt` (/compose) | refused | HermesCLI._handle_prompt_compose_command | local | slash.exec: refused | refused | client-local (cli_only) |-| `/queue` (/q) | refused | HermesCLI._cmd_queue | local | action: queue | refused | |-| `/quit` (/exit) | refused | HermesCLI._cmd_exit | local | unavailable: terminal | refused | client-local (cli_only) |-| `/reasoning` | control | HermesCLI._handle_reasoning_command | canonical route | action: reasoning | refused | per-session setting (gateway handler) |-| `/redraw` | refused | HermesCLI._cmd_redraw | local | unavailable: terminal | refused | client-local (cli_only) |-| `/refine` | control | HermesCLI._handle_refine_command | slash.exec | slash.exec | refused | |-| `/reload` | refused | HermesCLI._cmd_reload | canonical route | unavailable: terminal | refused | client-local (cli_only) |-| `/reload-mcp` (/reload_mcp) | refused | HermesCLI._confirm_and_reload_mcp | refused: not available yet | unavailable: advanced | refused | |-| `/reload-skills` (/reload_skills) | refused | HermesCLI._cmd_reload_skills | commands.catalog, skills.reload | unavailable: advanced | refused | |-| `/restart` | refused | messaging-only: unknown command | slash.exec: refused | unavailable: terminal | refused | messaging-only |-| `/resume` | refused | HermesCLI._handle_resume_command | local | picker: session | refused | switches the messaging chat's session; local clients resume by id |-| `/retry` | refused | HermesCLI._cmd_retry | canonical route | action: retry | refused | |-| `/review` | control | HermesCLI._handle_review_command | slash.exec | slash.exec | refused | |-| `/rollback` | refused | HermesCLI._handle_rollback_command | rollback.diff, rollback.list, rollback.restore | slash.exec: refused | refused | restores filesystem checkpoints |-| `/save` | refused | HermesCLI.save_conversation | session.save | rpc session.save | refused | writes an export file on the gateway host |-| `/sessions` | refused | HermesCLI._handle_sessions_command | local | picker: session | refused | messaging origin-scoped listing (`/sessions all` needs a messaging admin) |-| `/sethome` (/set-home) | refused | messaging-only: unknown command | slash.exec: refused | unavailable: terminal | refused | messaging-only |-| `/skills` | read (bare/`pending`/`diff`; `approve`/`reject`/`approval` control; hub refused) | HermesCLI._cmd_skills | slash.exec; sidecar: skills.manage | slash.exec | refused | client-local (cli_only) |-| `/skin` | refused | HermesCLI._handle_skin_command | config.get, config.set | action: skin | refused | client-local (cli_only) |-| `/snapshot` (/snap) | refused | HermesCLI._handle_snapshot_command | slash.exec: refused | unavailable: terminal | refused | client-local (cli_only) |-| `/start` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | refused | messaging-only |-| `/status` | read | HermesCLI._show_session_status | canonical route | slash.exec (rpc fallback) | refused | TUI session: main's `Hermes TUI Status` |-| `/statusbar` (/sb) | refused | HermesCLI._cmd_statusbar | local (preference not saved) | unavailable: terminal | refused | client-local (cli_only) |-| `/steer` (/s) | refused | HermesCLI._cmd_steer | canonical route | action: steer | refused | |-| `/stop` | refused | HermesCLI._handle_stop_command | canonical route | action: stop | refused | |-| `/subgoal` | control | HermesCLI._handle_subgoal_command | slash.exec | slash.exec | refused | |-| `/subscription` (/upgrade) | refused | HermesCLI._show_subscription | sidecar: subscription.state | slash.exec: refused | refused | client-local (cli_only) |-| `/suggestions` (/suggest) | read (bare only) | HermesCLI._handle_suggestions_command | slash.exec | slash.exec | refused | |-| `/timestamps` (/ts) | refused | HermesCLI._handle_timestamps_command | slash.exec: refused | slash.exec: refused | refused | client-local (cli_only) |-| `/title` | control | HermesCLI._cmd_title | canonical route | action: title | refused | |-| `/tools` | refused | HermesCLI._handle_tools_command | refused: not available yet | slash.exec: refused | refused | client-local (cli_only) |-| `/toolsets` | read | HermesCLI.show_toolsets | slash.exec | unavailable: terminal | refused | client-local (cli_only) |-| `/topic` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | refused | messaging-only |-| `/topup` | read | HermesCLI._show_billing | sidecar: billing.state | slash.exec | refused | |-| `/undo` | refused | HermesCLI._cmd_undo | canonical route | action: undo | refused | |-| `/update` | refused | HermesCLI._cmd_update | local | unavailable: terminal | refused | |-| `/usage` | read (bare only (`reset` refused)) | HermesCLI._handle_usage_command | canonical route | slash.exec | refused | |-| `/verbose` | control | HermesCLI._toggle_verbose | config.set | unavailable: terminal | refused | per-session setting (gateway handler) |-| `/version` (/v) | read | HermesCLI._cmd_version | slash.exec | slash.exec | refused | |-| `/voice` | control | HermesCLI._handle_voice_command | canonical route | unavailable: composer-voice | refused | per-session setting (gateway handler) |-| `/wake` | refused | HermesCLI._handle_wake_command | local | action: wake | refused | client-local (cli_only) |-| `/whoami` | read | HermesCLI._handle_whoami_command | slash.exec | slash.exec | refused | |-| `/worktree` | refused | HermesCLI._handle_worktree_command | slash.exec: refused | slash.exec: refused | refused | client-local (cli_only) |-| `/yolo` | control | HermesCLI._toggle_yolo | config.set | action: yolo | refused | per-session setting (gateway handler) |+| `/new` (/reset) | refused | HermesCLI._cmd_new | local | action: new | session.mutate reset | |+| `/palette` | refused | HermesCLI._open_command_palette | slash.exec: refused | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/paste` | refused | HermesCLI._handle_paste_command | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/pause` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | slash.exec: refused | messaging-only |+| `/personality` | control | HermesCLI._handle_personality_command | canonical route | slash.exec | slash.exec | per-session setting (gateway handler) |+| `/pet` | refused | HermesCLI._handle_pet_command | slash.exec | action: pet | slash.exec: refused | client-local (cli_only) |+| `/plan` | control | HermesCLI._handle_plan_command | slash.exec | slash.exec | slash.exec | |+| `/platform` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | slash.exec: refused | messaging adapters; `pause`/`resume` mutate them |+| `/platforms` (/gateway) | read | HermesCLI._show_gateway_status | slash.exec | unavailable: terminal | slash.exec | client-local (cli_only) |+| `/plugins` | refused | HermesCLI._cmd_plugins | slash.exec | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/profile` | read | HermesCLI._handle_profile_command | slash.exec | action: profile | slash.exec | |+| `/prompt` (/compose) | refused | HermesCLI._handle_prompt_compose_command | local | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/queue` (/q) | refused | HermesCLI._cmd_queue | local | action: queue | prompt.submit | |+| `/quit` (/exit) | refused | HermesCLI._cmd_exit | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/reasoning` | control | HermesCLI._handle_reasoning_command | canonical route | action: reasoning | slash.exec | per-session setting (gateway handler) |+| `/redraw` | refused | HermesCLI._cmd_redraw | local | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/refine` | control | HermesCLI._handle_refine_command | slash.exec | slash.exec | slash.exec | |+| `/reload` | refused | HermesCLI._cmd_reload | canonical route | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/reload-mcp` (/reload_mcp) | refused | HermesCLI._confirm_and_reload_mcp | refused: not available yet | unavailable: advanced | slash.exec: refused | |+| `/reload-skills` (/reload_skills) | refused | HermesCLI._cmd_reload_skills | commands.catalog, skills.reload | unavailable: advanced | slash.exec: refused | |+| `/restart` | refused | messaging-only: unknown command | slash.exec: refused | unavailable: terminal | slash.exec: refused | messaging-only |+| `/resume` | refused | HermesCLI._handle_resume_command | local | picker: session | slash.exec: refused | switches the messaging chat's session; local clients resume by id |+| `/retry` | refused | HermesCLI._cmd_retry | canonical route | action: retry | session.mutate rewind + resubmit | |+| `/review` | control | HermesCLI._handle_review_command | slash.exec | slash.exec | slash.exec | |+| `/rollback` | refused | HermesCLI._handle_rollback_command | rollback.diff, rollback.list, rollback.restore | slash.exec: refused | slash.exec: refused | restores filesystem checkpoints |+| `/save` | refused | HermesCLI.save_conversation | session.save | rpc session.save | slash.exec: refused | writes an export file on the gateway host |+| `/sessions` | refused | HermesCLI._handle_sessions_command | local | picker: session | slash.exec: refused | messaging origin-scoped listing (`/sessions all` needs a messaging admin) |+| `/sethome` (/set-home) | refused | messaging-only: unknown command | slash.exec: refused | unavailable: terminal | slash.exec: refused | messaging-only |+| `/skills` | read (bare/`pending`/`diff`; `approve`/`reject`/`approval` control; hub refused) | HermesCLI._cmd_skills | slash.exec; sidecar: skills.manage | slash.exec | slash.exec | client-local (cli_only) |+| `/skin` | refused | HermesCLI._handle_skin_command | config.get, config.set | action: skin | slash.exec: refused | client-local (cli_only) |+| `/snapshot` (/snap) | refused | HermesCLI._handle_snapshot_command | slash.exec: refused | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/start` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | slash.exec: refused | messaging-only |+| `/status` | read | HermesCLI._show_session_status | canonical route | slash.exec (rpc fallback) | slash.exec | TUI session: main's `Hermes TUI Status` |+| `/statusbar` (/sb) | refused | HermesCLI._cmd_statusbar | local (preference not saved) | unavailable: terminal | slash.exec: refused | client-local (cli_only) |+| `/steer` (/s) | refused | HermesCLI._cmd_steer | canonical route | action: steer | session.steer | |+| `/stop` | refused | HermesCLI._handle_stop_command | canonical route | action: stop | slash.exec: refused | |+| `/subgoal` | control | HermesCLI._handle_subgoal_command | slash.exec | slash.exec | slash.exec | |+| `/subscription` (/upgrade) | refused | HermesCLI._show_subscription | sidecar: subscription.state | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/suggestions` (/suggest) | read (bare only) | HermesCLI._handle_suggestions_command | slash.exec | slash.exec | slash.exec | |+| `/timestamps` (/ts) | refused | HermesCLI._handle_timestamps_command | slash.exec: refused | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/title` | control | HermesCLI._cmd_title | canonical route | action: title | session.mutate rename (bare: slash.exec) | |+| `/tools` | refused | HermesCLI._handle_tools_command | refused: not available yet | slash.exec: refused | session.info | client-local (cli_only) |+| `/toolsets` | read | HermesCLI.show_toolsets | slash.exec | unavailable: terminal | slash.exec | client-local (cli_only) |+| `/topic` | refused | messaging-only: unknown command | slash.exec: refused | slash.exec: refused | slash.exec: refused | messaging-only |+| `/topup` | read | HermesCLI._show_billing | sidecar: billing.state | slash.exec | slash.exec | |+| `/undo` | refused | HermesCLI._cmd_undo | canonical route | action: undo | session.mutate rewind | |+| `/update` | refused | HermesCLI._cmd_update | local | unavailable: terminal | slash.exec: refused | |+| `/usage` | read (bare only (`reset` refused)) | HermesCLI._handle_usage_command | canonical route | slash.exec | slash.exec | |+| `/verbose` | control | HermesCLI._toggle_verbose | config.set | unavailable: terminal | slash.exec | per-session setting (gateway handler) |+| `/version` (/v) | read | HermesCLI._cmd_version | slash.exec | slash.exec | slash.exec | |+| `/voice` | control | HermesCLI._handle_voice_command | canonical route | unavailable: composer-voice | slash.exec | per-session setting (gateway handler) |+| `/wake` | refused | HermesCLI._handle_wake_command | local | action: wake | slash.exec: refused | client-local (cli_only) |+| `/whoami` | read | HermesCLI._handle_whoami_command | slash.exec | slash.exec | slash.exec | |+| `/worktree` | refused | HermesCLI._handle_worktree_command | slash.exec: refused | slash.exec: refused | slash.exec: refused | client-local (cli_only) |+| `/yolo` | control | HermesCLI._toggle_yolo | config.set | action: yolo | slash.exec | per-session setting (gateway handler) |