From 0b0c1b326c4db8c7a421473863c2a3fcbad76aea Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:02:28 +0300 Subject: [PATCH] fix: openclaw migration overwrites model config dict with string (#3924) migrate_model_config() was writing `config["model"] = model_str` which replaces the entire model dict (default, provider, base_url) with a bare string. This causes 'str' object has no attribute 'get' errors throughout Hermes when any code does model_cfg.get("default"). Now preserves the existing model dict and only updates the "default" key, keeping provider/base_url intact. --- .../openclaw-migration/scripts/openclaw_to_hermes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py index f2e3d7af..ac99e2a6 100644 --- a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py +++ b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py @@ -1297,7 +1297,11 @@ class Migrator: if self.execute: backup_path = self.maybe_backup(destination) - hermes_config["model"] = model_str + existing_model = hermes_config.get("model") + if isinstance(existing_model, dict): + existing_model["default"] = model_str + else: + hermes_config["model"] = {"default": model_str} dump_yaml_file(destination, hermes_config) self.record("model-config", source_path, destination, "migrated", backup=str(backup_path) if backup_path else "", model=model_str) else: