Skip to content

fix(cli): guard quick_commands against non-dict values#18817

Closed
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/quick-commands-non-dict-crash
Closed

fix(cli): guard quick_commands against non-dict values#18817
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/quick-commands-non-dict-crash

Conversation

@shellybotmoyer

Copy link
Copy Markdown
Contributor

Fix: Guard quick_commands against non-dict values

Problem

When quick_commands values in ~/.hermes/config.yaml are not dicts (e.g., strings like foo: ''), the slash command dispatch at cli.py:6583 crashes with:

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

This blocks all matching slash commands — even valid skill commands — because quick_commands is checked before the skill dispatch chain.

Reproduction

# ~/.hermes/config.yaml
quick_commands:
  foo: ''

Then type /foo — crash.

Fix

Add isinstance(qcmd, dict) guard before accessing .get(). Non-dict entries now get a warning log and fall through to plugin/skill command checks instead of crashing.

Fixes #18816

Fixes NousResearch#18816. Add isinstance guard before qcmd.get() to prevent crash when quick_commands values are strings or other non-dict types.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 2, 2026
@shellybotmoyer

Copy link
Copy Markdown
Contributor Author

Superseded by #18850 which has the more complete fix with parity checks across CLI and gateway.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quick_commands with non-dict values crashes slash command dispatch

2 participants