fix(agent): disambiguate credential pool key lookup when multiple providers share the same base_url (#19083)#19122
Closed
Bartok9 wants to merge 0 commit into
Closed
Conversation
Collaborator
|
Likely duplicate of #14142 / #14141 — same root cause: credential pool keyed by base_url returns first-match when multiple custom_providers share the same URL. This PR adds name-based disambiguation to get_custom_provider_pool_key(). Also related to #19083 (the issue this fixes, which was itself flagged as dup of #14141). |
Collaborator
34b7a44 to
af312cc
Compare
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.
Problem
When multiple
custom_providersshare the samebase_url,get_custom_provider_pool_key(base_url)always returns the pool key for the first matching entry. Any other provider at that URL gets the wrong credentials. This is P1 — silently uses the wrong API key.Fix
Add an optional
provider_nameparameter. When provided, name-first lookup resolves the correct entry regardless of shared URLs:Call site in
seed_custom_provider_poolupdated to passmodel.nameas the hint.Backward compat: All existing callers that only pass
base_urlget the original first-match behaviour — no change for single-provider setups.Tests
test_get_custom_provider_pool_key_disambiguates_shared_base_urlcovers:All existing
test_get_custom_provider_pool_keyassertions still pass.Fixes #19083