Skip to content

fix(moa): tolerate non-list reference_models in hand-edited MoA preset config - #53556

Merged
teknium1 merged 2 commits into
mainfrom
fix/moa-nonlist-refs
Jun 27, 2026
Merged

fix(moa): tolerate non-list reference_models in hand-edited MoA preset config#53556
teknium1 merged 2 commits into
mainfrom
fix/moa-nonlist-refs

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

A hand-edited non-list reference_models in a MoA preset (e.g. reference_models: 2, or a single slot mapping written without the list wrapper) no longer crashes every MoA operation. _normalize_preset runs on every model-selection and MoA turn via resolve_moa_preset, so the unguarded iteration made the crash unrecoverable until the config was manually fixed.

Salvage of #53467 by @briandevans, cherry-picked onto current main.

Changes

  • hermes_cli/moa_config.py: in _normalize_preset, coerce a non-list reference_models before iterating — a bare dict is wrapped into a one-element list, anything else falls through to [] so the existing "no refs → defaults" path applies. No behavior change for the normal list case. This completes the same "tolerate hand-edited values" class as the prior f0678b031 scalar-field guards; aggregator was already safe via _clean_slot's dict check.
  • tests/hermes_cli/test_moa_config.py: regression coverage for a scalar value (degrades to defaults) and a bare-dict value (rescued into a list).

Validation

scripts/run_tests.sh tests/hermes_cli/test_moa_config.py → 15/15 passed.

Infographic

moa-nonlist-refs

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: fix/moa-nonlist-refs vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11481 on HEAD, 11483 on base (✅ -2)

🆕 New issues (1):

Rule Count
invalid-assignment 1
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`

✅ Fixed issues (2):

Rule Count
unresolved-attribute 2
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:3002: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`

Unchanged: 6031 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 27, 2026
@teknium1
teknium1 merged commit 17cb829 into main Jun 27, 2026
30 checks passed
@teknium1
teknium1 deleted the fix/moa-nonlist-refs branch June 27, 2026 10:43
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 P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants