fix(config): validate providers config entries — reject non-URL base, accept camelCase aliases (#9332)#12993
Merged
Merged
Conversation
… accept camelCase aliases (#9332) Cherry-picked from PR #9359 by @luyao618. - Accept camelCase aliases (apiKey, baseUrl, apiMode, keyEnv, defaultModel, contextLength, rateLimitDelay) with auto-mapping to snake_case + warning - Validate URL field values with urlparse (scheme + netloc check) — reject non-URL strings like 'openai-reverse-proxy' that were silently accepted - Warn on unknown keys in provider config entries - Re-order URL field priority: base_url > url > api (was api > url > base_url) - 12 new tests covering all scenarios Closes #9332
This was referenced Apr 20, 2026
fix(config): validate providers config entries — reject non-URL base, accept camelCase aliases
#9359
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Providers config entries now validate URL fields and accept camelCase key aliases, instead of silently ignoring misspelled keys and accepting non-URL strings as base_url.
Cherry-picked from PR #9359 by @luyao618 onto current main. Conflict resolution: merged import blocks (kept
import copyfrom HEAD + addedimport loggingfrom PR, dropped stalemanaged_nous_tools_enabledimport).Changes
hermes_cli/config.py: camelCase alias mapping (7 fields), urlparse validation on URL candidates, unknown key warnings, re-ordered URL field priority (base_url > url > api)tests/hermes_cli/test_provider_config_validation.py: 12 new testsValidation
apiKey: nvapi-...Bearer no-key-requiredapi_keywith warningbaseUrl: https://...base_urlwith warningapi: openai-reverse-proxyAPIConnectionErrorCloses #9332
Supersedes #9359, #9373, #9387, #9507