hermes - 💡(How to fix) Fix hermes doctor --fix does not fix custom_providers dict→list structure issue [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

hermes doctor correctly detects when custom_providers is a dict (old format) instead of a list (new format), but running hermes doctor --fix does not actually rewrite the config. The issue is reported every time, but the fix is never applied.

Error Message

Validate config structure (catches malformed custom_providers, etc.)

try: from hermes_cli.config import validate_config_structure config_issues = validate_config_structure() if config_issues: _section("Config Structure") for ci in config_issues: if ci.severity == "error": check_fail(ci.message) else: check_warn(ci.message) for hint_line in ci.hint.splitlines(): check_info(hint_line) issues.append(ci.message) # <-- always appended, never fixed except Exception: pass

Root Cause

In hermes_cli/doctor.py (lines 762-778), the validate_config_structure check reports config structure issues but has no should_fix branch. Compare with the stale root-level keys check (lines 746-756) which correctly handles should_fix by rewriting the config with atomic_yaml_write.

The relevant code block:

# Validate config structure (catches malformed custom_providers, etc.)
try:
    from hermes_cli.config import validate_config_structure
    config_issues = validate_config_structure()
    if config_issues:
        _section("Config Structure")
        for ci in config_issues:
            if ci.severity == "error":
                check_fail(ci.message)
            else:
                check_warn(ci.message)
            for hint_line in ci.hint.splitlines():
                check_info(hint_line)
            issues.append(ci.message)  # <-- always appended, never fixed
except Exception:
    pass

There is no if should_fix: block here, unlike every other check in the doctor (e.g. stale root keys at line 746, missing .env at line 508, missing config.yaml at line 695).

Fix Action

Fixed

Code Example

custom_providers:
     modelrelay:
       api: openai-completions
       base_url: http://op3:7352/v1

---

# Validate config structure (catches malformed custom_providers, etc.)
try:
    from hermes_cli.config import validate_config_structure
    config_issues = validate_config_structure()
    if config_issues:
        _section("Config Structure")
        for ci in config_issues:
            if ci.severity == "error":
                check_fail(ci.message)
            else:
                check_warn(ci.message)
            for hint_line in ci.hint.splitlines():
                check_info(hint_line)
            issues.append(ci.message)  # <-- always appended, never fixed
except Exception:
    pass

---

if should_fix:
    import yaml as _yaml
    config_path = HERMES_HOME / 'config.yaml'
    cfg = _yaml.safe_load(config_path.read_text(encoding="utf-8")) or {}
    cp = cfg.get("custom_providers")
    if isinstance(cp, dict):
        cfg["custom_providers"] = [
            {"name": k, **v} for k, v in cp.items()
        ]
        from utils import atomic_yaml_write
        atomic_yaml_write(config_path, cfg)
        check_ok("Converted custom_providers from dict to list format")
        fixed_count += 1
RAW_BUFFERClick to expand / collapse

Bug: hermes doctor --fix does not auto-fix custom_providers structure

Description

hermes doctor correctly detects when custom_providers is a dict (old format) instead of a list (new format), but running hermes doctor --fix does not actually rewrite the config. The issue is reported every time, but the fix is never applied.

Steps to reproduce

  1. Have a ~/.hermes/config.yaml with custom_providers as a dict:
    custom_providers:
      modelrelay:
        api: openai-completions
        base_url: http://op3:7352/v1
  2. Run hermes doctor — it reports:

    ✗ custom_providers is a dict — it must be a YAML list (items prefixed with '-')

  3. Run hermes doctor --fix — the same issue is still reported, nothing is fixed.

Root cause

In hermes_cli/doctor.py (lines 762-778), the validate_config_structure check reports config structure issues but has no should_fix branch. Compare with the stale root-level keys check (lines 746-756) which correctly handles should_fix by rewriting the config with atomic_yaml_write.

The relevant code block:

# Validate config structure (catches malformed custom_providers, etc.)
try:
    from hermes_cli.config import validate_config_structure
    config_issues = validate_config_structure()
    if config_issues:
        _section("Config Structure")
        for ci in config_issues:
            if ci.severity == "error":
                check_fail(ci.message)
            else:
                check_warn(ci.message)
            for hint_line in ci.hint.splitlines():
                check_info(hint_line)
            issues.append(ci.message)  # <-- always appended, never fixed
except Exception:
    pass

There is no if should_fix: block here, unlike every other check in the doctor (e.g. stale root keys at line 746, missing .env at line 508, missing config.yaml at line 695).

Expected behavior

When --fix is passed, the doctor should convert custom_providers from dict format to list format automatically, similar to how it already migrates stale root-level keys.

Suggested fix

Add a should_fix branch that transforms custom_providers from dict to list:

if should_fix:
    import yaml as _yaml
    config_path = HERMES_HOME / 'config.yaml'
    cfg = _yaml.safe_load(config_path.read_text(encoding="utf-8")) or {}
    cp = cfg.get("custom_providers")
    if isinstance(cp, dict):
        cfg["custom_providers"] = [
            {"name": k, **v} for k, v in cp.items()
        ]
        from utils import atomic_yaml_write
        atomic_yaml_write(config_path, cfg)
        check_ok("Converted custom_providers from dict to list format")
        fixed_count += 1

Environment

  • hermes-agent version: latest (v23 config)
  • Platform: Linux (WSL)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When --fix is passed, the doctor should convert custom_providers from dict format to list format automatically, similar to how it already migrates stale root-level keys.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix hermes doctor --fix does not fix custom_providers dict→list structure issue [1 pull requests]