fix(config): validate provider URLs and accept alias keys#9507
Closed
anthhub wants to merge 1 commit into
Closed
Conversation
b52114d to
fa449dd
Compare
Author
|
Rebased this PR onto the latest Re-ran the focused regression coverage after the rebase:
This remains a single-purpose config/runtime-provider fix. Happy to adjust or split further if that would make review easier. |
Contributor
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
Tighten
providers:normalization so invalidapistrings are no longer silently treated asbase_url, while camelCase aliases likeapiKey,baseUrl, andapiModecontinue to work with deprecation warnings.Related Issue
Fixes #9332
Type of Change
Changes Made
providers.*URL candidates before accepting them asbase_urlapiKey,baseUrl,apiMode, etc.) and warn about deprecated field namesruntime_providerso directproviders:resolution honors aliases,api_key, andapi_modeapivaluesHow to Test
. venv/bin/activatepython -m pytest tests/hermes_cli/test_config.py tests/hermes_cli/test_user_providers_model_switch.py tests/hermes_cli/test_runtime_provider_resolution.py -qproviders:entry withbaseUrl/apiKeyresolves correctly and that a non-URLapi:value is ignored with a warningChecklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping