fix(auxiliary): support named custom providers in auxiliary tasks / 辅助任务支持命名自定义 provider - #37261
Closed
WenhuaXia wants to merge 1 commit into
Closed
fix(auxiliary): support named custom providers in auxiliary tasks / 辅助任务支持命名自定义 provider#37261WenhuaXia wants to merge 1 commit into
WenhuaXia wants to merge 1 commit into
Conversation
WenhuaXia
force-pushed
the
fix/custom-provider-vision-auxiliary
branch
from
June 2, 2026 08:04
d06f1e0 to
7fc9103
Compare
WenhuaXia
force-pushed
the
fix/custom-provider-vision-auxiliary
branch
from
June 6, 2026 14:31
7fc9103 to
b965f35
Compare
WenhuaXia
force-pushed
the
fix/custom-provider-vision-auxiliary
branch
5 times, most recently
from
June 21, 2026 19:49
d76a090 to
23bdcc4
Compare
辅助任务现在可以正确解析命名自定义 provider(custom:name)。 Before this fix, _normalize_aux_provider() would strip the "custom:" prefix and return bare "custom", which routes through the anonymous-custom path (reading model.base_url + OPENAI_API_KEY from config/env). Users with named custom_providers (e.g. custom:qwen) but no OPENAI_API_KEY set would silently get "Goal judge is not configured" or broken vision tasks. Two changes: 1. Remove the early return in _normalize_aux_provider() that stripped custom:xxx → custom. Named custom providers are now preserved intact so resolve_provider_client can route them through the named-custom-provider branch which reads custom_providers from config.yaml. 2. Add a fallback in _resolve_custom_runtime(): when requested="custom" falls back to OpenRouter (because no bare "custom" entry exists), try resolve_runtime_provider(requested=None) to pick up the user's actual main provider. This is a safety net for code paths that still call with bare "custom". Affected tasks: vision, goal_judge, compression, web_extract, etc. Any auxiliary task that uses "custom:name" as provider now works. 修复前:_normalize_aux_provider() 会把 custom:qwen 强制 strip 成 "custom", 导致所有带命名自定义 provider 的辅助任务(vision、goal_judge 等)都走匿名 custom 路径(读环境变量 OPENAI_BASE_URL/API_KEY)。用户如果没有设置这些 环境变量,辅助任务就静默失败。 修复后: 1. 移除 strip 逻辑,保留 custom:name 完整字符串,让 resolve_provider_client 走 named custom provider 分支,从 custom_providers 读取 base_url + api_key。 2. 在 _resolve_custom_runtime() 增加 fallback:当 "custom" 回退到 OpenRouter 时,尝试用 requested=None 重新解析用户实际的主 provider 作为兜底。 影响范围:vision(图像识别)、goal_judge、compression、web_extract 等 所有使用 custom:name 作为 provider 的辅助任务现在都正常工作。 Fixes: custom provider vision tasks broken, goal judge unavailable Related: NousResearch#37182
WenhuaXia
force-pushed
the
fix/custom-provider-vision-auxiliary
branch
from
July 8, 2026 15:36
23bdcc4 to
f273e3f
Compare
Contributor
|
Thanks for tracing the named custom-provider failure mode. This is now covered on current
Closing as implemented on main. |
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 / 概述
辅助任务现在可以正确解析命名自定义 provider(
custom:name),修复了 vision(图像识别)、goal_judge 等任务在使用自定义 provider 时静默失效的问题。Auxiliary tasks can now correctly resolve named custom providers (
custom:name), fixing silent failures in vision, goal_judge, and other tasks when using custom providers.Root Cause / 根因
_normalize_aux_provider()would stripcustom:qwen→custom, forcing all named custom providers through the anonymous-custom path (readsmodel.base_url+OPENAI_API_KEYfrom env). Users withcustom_providersin config but noOPENAI_API_KEYenv var set would get broken auxiliary tasks._normalize_aux_provider()会把custom:qwen强制 strip 成custom,导致所有命名自定义 provider 都走匿名 custom 路径(读环境变量OPENAI_API_KEY)。如果用户没设置这个环境变量,辅助任务就静默失败。Changes / 改动
Remove the early return in
_normalize_aux_provider()—custom:nameis now preserved intact soresolve_provider_clientcan route through the named-custom-provider branch, which reads fromcustom_providersin config.yaml.移除
_normalize_aux_provider()中 stripcustom:name的 early return。resolve_provider_client现在可以正确走 named custom provider 分支,从custom_providers读取 base_url + api_key。Add fallback in
_resolve_custom_runtime()— whenrequested="custom"falls back to OpenRouter (because no barecustomentry exists), tryresolve_runtime_provider(requested=None)to pick up the user's actual main provider as a safety net.在
_resolve_custom_runtime()增加 fallback:当custom回退到 OpenRouter 时,尝试用requested=None重新解析用户实际的主 provider 作为兜底。Affected Tasks / 影响范围
Any auxiliary task that uses
custom:nameas provider:vision(image recognition / 图像识别)goal_judge(automatic goal continuation / 目标自动延续)compression,web_extract, etc.所有使用
custom:name作为 provider 的辅助任务:Testing / 测试
All existing tests pass (32 tests in
test_auxiliary_client.py+test_auxiliary_named_custom_providers.py).所有已有测试通过(
test_auxiliary_client.py+test_auxiliary_named_custom_providers.py共 32 个测试)。Related: #37182