Skip to content

fix(config): restore custom provider resolution and nested config han…#8963

Open
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-43
Open

fix(config): restore custom provider resolution and nested config han…#8963
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-43

Conversation

@devorun

@devorun devorun commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

…dling (#8919)

What does this PR do? Fixes #8919

Custom providers (e.g. LiteLLM on localhost) were ignored and Hermes defaulted to OpenAI endpoints, causing 401 errors.

bug

  • CLI intercepting nested *_API_KEY keys (e.g. model.api_key)
  • api_base vs base_url schema mismatch
  • Missing runtime hydration of HERMES_INFERENCE_PROVIDER and OPENAI_BASE_URL
  • hermes config get lacking nested key traversal

Fix

  • Scoped _API_KEY interception to ignore nested keys
  • Added api_base → base_url normalization in load_config
  • Hydrated provider settings from env vars at runtime
  • Implemented nested key traversal for config get

Restores reliable configuration for custom providers and fixes CLI config behavior.

Related Issue

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

@malaiwah

Copy link
Copy Markdown
Contributor

Related to #4913 / #4914 (also open) — those fix the same user-visible symptom (custom LiteLLM endpoint → 401s) but at a different layer: fetch_endpoint_model_metadata() sending unauthenticated /models requests when no explicit api_key is passed. The fixes are complementary — this PR addresses the config loading pipeline (api_base→base_url normalization, _API_KEY interception scoping, runtime hydration), while #4914 covers the metadata/pricing lookup path that still hits the endpoint without auth even after config is correctly loaded.

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 27, 2026
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 P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: custom provider config ignored at runtime

3 participants