From 8dd4e576d0f061df570e5f5101bd9bd3417914d4 Mon Sep 17 00:00:00 2001 From: briandevans <252620095+briandevans@users.noreply.github.com> Date: Sat, 27 Jun 2026 00:39:49 -0700 Subject: [PATCH] fix(moa): tolerate non-list reference_models in hand-edited MoA preset config --- hermes_cli/moa_config.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hermes_cli/moa_config.py b/hermes_cli/moa_config.py index bef4b472cee..70566689adc 100644 --- a/hermes_cli/moa_config.py +++ b/hermes_cli/moa_config.py @@ -74,7 +74,13 @@ def _normalize_preset(raw: Any) -> dict[str, Any]: if not isinstance(raw, dict): raw = {} - refs = [_clean_slot(item) for item in raw.get("reference_models") or []] + raw_refs = raw.get("reference_models") + 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 + # for the scalar fields below (reference_temperature / max_tokens). + raw_refs = [raw_refs] if isinstance(raw_refs, dict) else [] + refs = [_clean_slot(item) for item in raw_refs] refs = [item for item in refs if item is not None] if not refs: refs = deepcopy(DEFAULT_MOA_REFERENCE_MODELS)