Skip to content

fix(installer): a fallback list of mappings converges - #25

Merged
macd2 merged 1 commit into
macd2:mainfrom
keyz182:fix/override-list-converge
Nov 1, 2026
Merged

macd2 merged 1 commit into
macd2:mainfrom
keyz182:fix/override-list-converge

Conversation

@keyz182

@keyz182 keyz182 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What and why

A follow-up to #24. An owner override such as

fallback_providers = [{"provider":"litellm","model":"reason"}]

is applied on every install, and install.py --check never comes back clean. Hermes prints a list of mappings as a YAML block (- provider: litellm with model: reason under it). The installer compared that text with the JSON line in settings.conf, so the two never matched.

_cfg now reads such a block back as a list of mappings. settings_problems and _apply_settings compare both sides in one form (JSON, sorted keys, values as text). Other values compare as before. There is no new dependency, so the installer still runs on a plain python3.

The #24 tests missed this because the test double printed every list as - item lines. tests/hermes_fake.py now prints a mapping list the way Hermes does.

Related issue

Follow-up to #24.

Type of change

  • Bug fix
  • Cross-platform (Windows / WSL / macOS)
  • Security hardening (not an undisclosed vulnerability: those go to private reporting, see SECURITY.md)
  • Robustness / board
  • New feature
  • Docs or tests only

How to test

  1. python -m pytest tests -q. Two new tests are in tests/test_install_template_overrides.py. One checks that a JSON fallback list is applied once and then reports clean. The other checks that a different mapping is still reported.
  2. On a real install, put the line above in <Hermes home>/crew/templates/worker/settings.conf. Run install.py, then install.py --check. fallback_providers is no longer listed for the worker profile.

Platform tested on

Linux: the test suite on Python 3.12, and step 2 against 4 real role profiles on Ubuntu 26.04. Not run on Windows or macOS. The change is string parsing only, with no paths or processes.

Checklist

  • One logical change, no unrelated commits
  • Commits follow Conventional Commits (fix(scope):, feat(scope):)
  • python -m pytest tests -q passes (894 passed, 3 skipped)
  • I added tests, or said above why not
  • Works on Windows, macOS and Linux, or I said above what I could not check
  • No machine-specific strings (home paths, hostnames, emails) in the diff

An owner override such as
fallback_providers = [{"provider":"litellm","model":"reason"}]
was applied on every install and --check never came back clean. Hermes
prints a list of mappings as a YAML block, and the installer compared
that text with the JSON line in settings.conf, so the two never matched.

_cfg now reads such a block back as a list of mappings, and the check
and the install compare both sides in one form (JSON, sorted keys,
values as text). Other values compare as before. No new dependency: the
installer still runs on a plain python3.

The test double now prints a mapping list the way Hermes does, which is
why the existing tests did not catch this.
@macd2
macd2 merged commit 8e1144c into macd2:main Nov 1, 2026
4 checks passed
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