fix(gateway): expand fallback env references - #21029
Open
LeonSGP43 wants to merge 1 commit into
Open
Conversation
Collaborator
Contributor
|
Test assertion looks incorrect — the expected value won't match. In
assert GatewayRunner._load_fallback_model() == {
"provider": "custom",
"model": "deepseek-chat",
- "api_key": "resolv...-key",
+ "api_key": "resolved-model-key",
} |
Contributor
|
Thanks for identifying the gateway fallback expansion gap. The problem remains on current main, but this branch needs a targeted salvage because the fallback implementation moved. Problems
Suggested changes
Automated hermes-sweeper review. |
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
Fixes #20974.
Gateway mode had two raw
config.yamlfallback readers that skipped the config env expansion step used by the CLI loaders. Whenfallback_model.api_keyorfallback_providers[].api_keycontained${VAR}, the literal placeholder could reach fallback client creation and fail authentication.This PR expands env references after gateway fallback YAML reads in:
_try_resolve_fallback_provider()for auth-fallback runtime resolutionGatewayRunner._load_fallback_model()for the fallback model chain passed toAIAgentTests
scripts/run_tests.sh tests/gateway/test_auth_fallback.py(4 passed, 4 warnings)python -m py_compile gateway/run.py tests/gateway/test_auth_fallback.pygit diff --check