Skip to content

fix(config): validate providers config entries — reject non-URL base, accept camelCase aliases (#9332)#12993

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-bd16abe6
Apr 20, 2026
Merged

fix(config): validate providers config entries — reject non-URL base, accept camelCase aliases (#9332)#12993
teknium1 merged 1 commit into
mainfrom
hermes/hermes-bd16abe6

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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 copy from HEAD + added import logging from PR, dropped stale managed_nous_tools_enabled import).

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 tests

Validation

Before After
apiKey: nvapi-... Silently ignored → Bearer no-key-required Auto-mapped to api_key with warning
baseUrl: https://... Silently ignored → no URL Auto-mapped to base_url with warning
api: openai-reverse-proxy Accepted as base_url → APIConnectionError Rejected (no scheme/netloc), warning logged
Unknown keys Silent Warning logged listing unrecognized keys

Closes #9332
Supersedes #9359, #9373, #9387, #9507

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: providers: config entries silently ignore apiKey/baseUrl and accept non-URL strings as base_url via the api field

2 participants