Skip to content

fix(cli): prevent crash in save_config_value when model is a string - #83

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/cli-save-config-string-model
Feb 27, 2026
Merged

fix(cli): prevent crash in save_config_value when model is a string#83
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/cli-save-config-string-model

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • save_config_value() crashes with TypeError when the config file uses the string model format (model: "anthropic/claude-opus-4") because it assumes all intermediate keys are dicts
  • Added an isinstance(current[key], dict) check so non-dict values are replaced with a fresh dict before descending

Reproduction

  1. Set ~/.hermes/config.yaml to:
    model: "anthropic/claude-opus-4"
  2. Run the CLI and type /model some-other-model
  3. Before fix: TypeError: 'str' object does not support item assignment
  4. After fix: Model saved correctly as model: {default: "some-other-model"}

load_cli_config() supports both string and dict formats for the model
key (e.g. `model: "anthropic/claude-opus-4"`), but save_config_value()
assumed all intermediate keys are dicts. When the config file used the
string format, running `/model <name>` would crash with TypeError:
'str' object does not support item assignment.

Add an isinstance check so non-dict values are replaced with a fresh
dict before descending.
@teknium1
teknium1 merged commit 8174f5a into NousResearch:main Feb 27, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ring-model

fix(cli): prevent crash in save_config_value when model is a string
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…s2vu6e

fix(cron): add missing `_contains_gateway_lifecycle_command` to hermes_cli.cron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants