Skip to content

fix(config): warn loudly on YAML parse failure instead of silent default fallback#23585

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-04bc4ccd
May 11, 2026
Merged

fix(config): warn loudly on YAML parse failure instead of silent default fallback#23585
teknium1 merged 1 commit into
mainfrom
hermes/hermes-04bc4ccd

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Closes part of #23570 (silent config-parse failure → all overrides ignored).

Summary

A YAML parse error in ~/.hermes/config.yaml printed one line to stdout and silently fell back to DEFAULT_CONFIG, dropping every user override. The reporter's auxiliary.compression and fallback-chain settings never applied — aux fell to OpenRouter (depleted) instead of the configured Codex/MiniMax chain, and there was no signal anything was wrong.

Changes

  • hermes_cli/config.py: new _warn_config_parse_failure() helper. Both parse-failure sites (_load_raw_config, load_config) route through it.
    • WARNING-level log → file (hermes logs surfaces it)
    • stderr line with ⚠️ prefix → visible at startup before logging is fully wired
    • dedup on (path, mtime_ns, size) so concurrent CLI/gateway loads don't spam
    • re-warns automatically after the user edits the file (different mtime)
  • tests/hermes_cli/test_config.py: new TestLoadConfigParseFailure (3 tests) covering log + stderr emission, dedup, and re-warn after edit

Validation

Before After
User-visible signal one print() to stdout, scrolls past WARNING log + stderr ⚠️ line with file path + impact
Dedup across concurrent loads none per (path, mtime, size)
Re-warn after edit n/a yes (mtime changes)
Targeted tests 0 3 (passing)
tests/hermes_cli/ 4191 passed, 7 unrelated failures 4194 passed, same 7 unrelated failures

The 7 unrelated failures (test_api_key_providers, test_setup_openclaw_migration, test_update_gateway_restart, test_web_server::TestPluginAPIAuth) reproduce on bare origin/main — pre-existing.

Refs #23570 (config-parse silence is one of three root causes — separate PRs forthcoming for the other two: aux 402-unhealthy cache, native image-data-URL replay).

…ult fallback

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue #23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs #23570
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-04bc4ccd 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: 8146 on HEAD, 8146 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4280 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 area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels May 11, 2026
@teknium1 teknium1 merged commit 228a4d1 into main May 11, 2026
15 of 18 checks passed
@teknium1 teknium1 deleted the hermes/hermes-04bc4ccd branch May 11, 2026 05:36
rmulligan pushed a commit to rmulligan/hermes-agent that referenced this pull request May 11, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
JinyuID pushed a commit to JinyuID/hermes-agent that referenced this pull request May 11, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
AlexFoxD pushed a commit to AlexFoxD/hermes-agent that referenced this pull request May 21, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ult fallback (NousResearch#23585)

A YAML parse error in ~/.hermes/config.yaml caused load_config() to print
one line to stdout (Warning: Failed to load config: ...) and silently fall
back to DEFAULT_CONFIG, dropping every user override (auxiliary providers,
fallback chain, model settings). Users only noticed when downstream
behavior misbehaved — see issue NousResearch#23570 where a tab-indent error in the
auxiliary section caused aux fallback to use OpenRouter (depleted) instead
of the configured Codex/MiniMax chain.

Now: log at WARNING (so 'hermes logs' surfaces it), write a prominent line
to stderr, dedup on (path, mtime_ns, size) so concurrent loads don't spam,
and re-warn after the user edits the file. Both call sites (raw read +
merged load) route through the same helper.

Refs NousResearch#23570
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants