diff --git a/hermes_cli/moa_config.py b/hermes_cli/moa_config.py index bf40976dc2ac..9353587fe722 100644 --- a/hermes_cli/moa_config.py +++ b/hermes_cli/moa_config.py @@ -207,6 +207,12 @@ def _normalize_preset(raw: Any) -> dict[str, Any]: raw = {} raw_refs = raw.get("reference_models") + # reference_models may be a JSON string (hand-edited config.yaml) or a list. + if isinstance(raw_refs, str): + try: + raw_refs = json.loads(raw_refs) + except (json.JSONDecodeError, ValueError): + raw_refs = [] if not isinstance(raw_refs, list): # A hand-edited scalar / single mapping (or a bad type) must degrade to # defaults instead of crashing the iteration, mirroring the tolerance