Skip to content

Bug: profile config providers dict replaces/clears default providers instead of inheriting #43713

Open

Description

@epro1506

Problem

When a sub-profile (e.g., ~/.hermes/profiles/builder/config.yaml) is loaded, any providers block in the sub-profile REPLACES the default config providers entirely. If the sub-profile has providers: {} (as generated by hermes profile create), all default providers are lost.

This means:

Steps to reproduce

  1. Define providers in default config.yaml with openrouter and API key
  2. Create a profile: hermes profile create builder
  3. Set model.provider: openrouter in the profile config
  4. Try to use the profile: hermes -p builder "test"
  5. Auth fails — no OpenRouter key found, because the profiles empty providers: {} wiped the default

Expected behavior

Profile configs should MERGE with default config, not replace it. Specifically:

  • providers dict should inherit + override at key level (profile can add/override specific providers without losing defaults)
  • custom_providers should inherit from default (same merge semantics)
  • credential_pool_strategies should inherit

Workaround

Manually sync providers blocks across all profiles. Every config change requires touching N+1 files.

Environment

Hermes v0.16.0, macOS 26.5.1, Mac Mini M4 Pro. 5 profiles (builder, researcher, writer, validator, reasoner) all affected.

Related

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/cliCLI entry point, hermes_cli/, setup wizard
    area/configConfig system, migrations, profiles
    on Jun 10, 2026
  2. liuhao1024 commented on Jun 10, 2026

    @liuhao1024

    This is fixed by #43765 — inherits the default root config when loading profile configs, so profile-scoped provider overrides merge with (rather than replace) the default providers.

  3. GottZ commented on Jul 29, 2026

    @GottZ

    This was generated by AI during triage.

    Summary

    Four PRs address or reference this issue complex: #20964 and #41741 implement broad opt-in profile inheritance, while #43765 and #43816 directly merge the root configuration beneath profile configuration to preserve providers and related credentials. All four reach the reported provider-loss cause through live root-to-profile coupling, but only #43765 is the focused canonical fix with dedicated regression coverage.

    Related pull requests

    Duplicates

    #43765 and #43816 implement substantially the same automatic root-config base merge; #41741 is a broader salvage/superseding implementation of #20964's inheritance feature.

    Suggested consolidation

    Merge #43765 only after the contributor's keep_open review is resolved by adding root-config cache invalidation and obtaining an explicit scoped design decision for provider/credential inheritance versus the documented profile-isolation contract; its focused diff and regression suite make it the best consolidation target. Keep #41741 closed, close #20964 as the rejected broad-inheritance approach, and retain #43816 closed as a duplicate superseded by #43765.

    Complex graph

    flowchart LR
        classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
        classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
        classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
        classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
        classDef best stroke-width:3px,stroke:#b45309
        classDef target stroke-width:3px,stroke:#4338ca
        I20270(["issue #20270 (closed)"])
        I43713(["issue #43713 (open)"])
        subgraph Dup20964 ["PRs duplicating each other"]
            P20964["PR #20964 (open)"]
            P41741["PR #41741 (closed)"]
        end
        subgraph Dup43765 ["PRs duplicating each other"]
            P43765["PR #43765 (open)"]
            P43816["PR #43816 (closed)"]
        end
        P20964 -.->|partial| I43713
        P41741 -.->|partial| I43713
        P43765 -->|best fix| I43713
        P43816 -.->|partial| I43713
        P20964 -.->|partial| I20270
        P41741 -->|best fix| I20270
        P43765 -.->|partial| I20270
        P43816 -.->|partial| I20270
        class I20270 closed
        class I43713 open
        class I43713 target
        class P20964 open
        class P41741 closed
        class P43765 open
        class P43816 closed
        class P41741 best
        class P43765 best
        click I20270 "https://github.com/NousResearch/hermes-agent/issues/20270"
        click I43713 "https://github.com/NousResearch/hermes-agent/issues/43713"
        click P20964 "https://github.com/NousResearch/hermes-agent/pull/20964"
        click P41741 "https://github.com/NousResearch/hermes-agent/pull/41741"
        click P43765 "https://github.com/NousResearch/hermes-agent/pull/43765"
        click P43816 "https://github.com/NousResearch/hermes-agent/pull/43816"
    
    Loading

    Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).

    Cross-PR triage: Reviewed 4 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 81 kB of PR diffs, 17 kB of issue/PR text, 6 kB of discussion (10 comments), 12 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  4. gavmor commented on Nov 5, 2026

    @gavmor

    Kanban/worker-profile case, which also exercises a list-typed setting that the dict-merge PRs (#43765, #43816) may not cover.

    Setup: one kanban orchestrator dispatches to 11 worker profiles, each its own HERMES_HOME (~/.hermes/profiles/<name>/config.yaml). The root config.yaml declares the chain:

    fallback_providers:
      - provider: deepseek
        model: deepseek-flash
      - provider: openai-codex
        model: gpt-6.1-terra
      - provider: custom
        model: gemini-3.8-flash-medium
        base_url: http://127.0.0.1:8005/v1

    Every worker needs that same chain, because each runs the agent loop in its own home.

    Reproduction on v0.21.6+529.g6660547:

    1. copy a profile, delete fallback_providers from its config.yaml
    2. hermes --profile <name> config get fallback_providers → []

    An absent key resolves to DEFAULT_CONFIG's [] (hermes_cli/config_defaults.py:36), not to the root chain, so profiles neither inherit nor point at it.

    Real-world cost: when both Codex quota and the Antigravity bridge were 429, the fix was hand-editing 11 files to put a working provider first. Change the root chain later and 10 workers silently keep the old one — they surface it as "provider rate-limited every attempt" rather than failing over.

    Request, beyond the dict merge: please define list-typed inheritance semantics too. Suggested shape, consistent with delegation.fallback_providers: [] already meaning "disable":

    • key absent in the profile → inherit the root list
    • key explicitly [] → opt out

    Otherwise fallback_providers, custom_providers and any future list setting stay copy-paste config indefinitely.

    I also see docs/developer-guide/contributing.md:97 recording that live inheritance from the default profile was closed as intentional design (with --clone as the answer). --clone is creation-time only, so it does not help an existing profile fleet. If full inheritance is still off the table, an explicit opt-in allowlist (e.g. inherit_from_root: [fallback_providers]) would fix the drift without coupling profiles wholesale.

  5. alt-glitch commented on Nov 10, 2026

    @alt-glitch

    #43765 aims to fix this: it makes profile configs inherit the default root config, so providers, custom providers, and credential pool strategies merge key by key instead of being replaced.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/authAuthentication, OAuth, credential poolsarea/configConfig system, migrations, profilesarea/profilesMulti-profile isolation, HERMES_HOME scopingcomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions