fix(auxiliary): pass cfg_base_url/cfg_api_key for named providers, prevent force-routing to custom - #24455
Closed
hookinglau wants to merge 1 commit into
Closed
Conversation
… provider _resolve_task_provider_model drops cfg_base_url and cfg_api_key when returning a named provider, causing configured API keys and base URLs to be lost. Pass them through so named providers can use custom endpoints while still resolving credentials from provider-specific env vars. Closes NousResearch#20139
hookinglau
force-pushed
the
fix/auxiliary-vision-baseurl-custom-provider
branch
from
May 12, 2026 16:55
ceb3c7a to
0d3ab02
Compare
Collaborator
Contributor
|
Merged via PR #24619. Your commit was cherry-picked onto current main with your authorship preserved. Tests passed (155/155). Thanks for the fix! |
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
Two bugs in
agent/auxiliary_client.pycause auxiliary tasks (vision, compression, etc.) to fail with 401 when using a named provider withbase_urlset in config.Bug 1 (reported in #20139)
_resolve_task_provider_modeldropscfg_base_urlandcfg_api_keywhen returning a named provider, so configured API keys are lost.Bug 2
async_call_llmunconditionally passesbase_urltoresolve_vision_provider_client. This triggers_resolve_task_provider_modelline 3800 (if base_url: return "custom"), which force-routes through the "custom" provider path that only checksOPENAI_API_KEY— ignoring provider-specific env vars likeDASHSCOPE_API_KEY.How to reproduce:
Send an image via WeChat → 401 despite valid
DASHSCOPE_API_KEYin.env.Fix
_resolve_task_provider_model: passcfg_base_urlandcfg_api_keyfor named providers (one-line change, closes fix(auxiliary): pass cfg_base_url and cfg_api_key when resolving task provider #20139)async_call_llm: only passbase_urltoresolve_vision_provider_clientwhen provider is"custom", preventing known providers from being force-routed through the custom pathTesting