You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When users configure an auxiliary task (e.g. auxiliary.vision) with provider, base_url, and api_key all set, the provider name is silently discarded and replaced with "custom".
This causes provider-specific code paths (ZAI vision max_tokens skip, Anthropic transport detection, custom headers, etc.) to be bypassed, leading to subtle failures.
ifcfg_base_urlandcfg_api_key:
# Both base_url and api_key explicitly set -> custom endpoint.return"custom", resolved_model, cfg_base_url, cfg_api_key, resolved_api_mode
This branch ignores cfg_provider entirely. The subsequent code in resolve_vision_provider_client and _build_call_kwargs can no longer distinguish between:
A user who explicitly set provider: glm with a specific GLM endpoint
A user who set a truly custom endpoint with provider: custom
No ZAI vision fast-path: resolve_vision_provider_client line 3562-3587 has a dedicated ZAI OpenAI-wire route that forces api_mode="chat_completions" -- but it only triggers for requested == "zai", never for "custom"
No provider headers: GLM, Xiaomi MiMo, and other providers that need custom headers via provider profiles get skipped
Suggested Fix
When cfg_provider is set alongside base_url + api_key, preserve the provider name:
Description
When users configure an auxiliary task (e.g.
auxiliary.vision) withprovider,base_url, andapi_keyall set, the provider name is silently discarded and replaced with"custom".This causes provider-specific code paths (ZAI vision max_tokens skip, Anthropic transport detection, custom headers, etc.) to be bypassed, leading to subtle failures.
Steps to Reproduce
Root Cause
In
_resolve_task_provider_model(line 3985-3987):This branch ignores
cfg_providerentirely. The subsequent code inresolve_vision_provider_clientand_build_call_kwargscan no longer distinguish between:provider: glmwith a specific GLM endpointprovider: customImpact
max_tokenssent to GLM vision API -> error 1210 (the_skip_max_tokensguard only checksprovider == "zai")resolve_vision_provider_clientline 3562-3587 has a dedicated ZAI OpenAI-wire route that forcesapi_mode="chat_completions"-- but it only triggers forrequested == "zai", never for"custom"Suggested Fix
When
cfg_provideris set alongsidebase_url+api_key, preserve the provider name:This way the downstream code can still apply provider-specific logic while using the explicit endpoint credentials.
Environment
provider+base_url+api_keyconfigured together