Skip to content

quick_commands with non-dict values crashes slash command dispatch #18816

@RizwanHamid

Description

@RizwanHamid

Bug

cli.py:6577 calls qcmd.get("type") on whatever value is in quick_commands — no validation that it is actually a dict.

Reproduction

  1. Add this to ~/.hermes/config.yaml:
    quick_commands:
      foo: ''
  2. Start Hermes CLI
  3. Type /foo

Result

Error: 'str' object has no attribute 'get'

All slash commands that match a quick_commands key crash — even if the key overlaps with a valid skill command, because quick_commands is checked BEFORE skill commands in the dispatch chain. For example, if both quick_commands.mul-agents (string) and a skill command /mul-agents exist, the broken quick_commands entry poisons /mul-agents and prevents the skill from loading.

Location

cli.py:6573-6577:

base_cmd = cmd_lower.split()[0]
quick_commands = self.config.get("quick_commands", {})
if base_cmd.lstrip("/") in quick_commands:
    qcmd = quick_commands[base_cmd.lstrip("/")]
    if qcmd.get("type") == "exec":          # <-- crash: str has no .get()

Fix

Guard with isinstance(qcmd, dict) before accessing dict methods:

if not isinstance(qcmd, dict):
    logger.warning(f"quick_commands entry for {base_cmd} is not a dict, skipping")
    # fall through to plugin commands / skill commands checks
elif qcmd.get("type") == "exec":
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions