Skip to content

fix(vision): forward custom-endpoint credentials + read aux model from config.yaml - #57651

Merged
teknium1 merged 4 commits into
mainfrom
fix/aux-vision-custom-creds
Jul 3, 2026
Merged

fix(vision): forward custom-endpoint credentials + read aux model from config.yaml#57651
teknium1 merged 4 commits into
mainfrom
fix/aux-vision-custom-creds

Conversation

@teknium1

@teknium1 teknium1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Auxiliary vision credential/config resolution fixed for custom-endpoint users: the vision auto-detect chain now forwards the live custom endpoint credentials instead of returning "No LLM provider configured", and vision_analyze / video_analyze read the aux model from config.yaml before the legacy env var. Fixes #50685's premise and #53749.

Root causes:

  1. resolve_vision_provider_client() auto-branch called resolve_provider_client("custom", ...) without explicit_base_url/explicit_api_key; the generic custom id has no built-in endpoint, so resolution fell through to aggregators and failed for custom-main users with no aggregator keys.
  2. _handle_vision_analyze / _handle_video_analyze read only AUXILIARY_VISION_MODEL/AUXILIARY_VIDEO_MODEL env vars, ignoring auxiliary.vision.model / auxiliary.video.model in config.yaml.

Changes

Validation

Test file Result
tests/agent/test_auxiliary_main_first.py (incl. new TestResolveVisionCustomProvider) pass
tests/tools/test_vision_tools.py pass

Closes #53749. Salvages #50685 and #53754 with contributor authorship preserved. (#57286 and #43297 overlap this area — reviewed; #50685's runtime-first approach supersedes #43297's config-read approach, and #57286's provider/base_url/api_key forwarding is already covered by the call_llm task-config resolution once the custom-endpoint chain works.)

Infographic

aux-vision-credentials

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/vision Vision analysis and image generation P2 Medium — degraded but workaround exists labels Jul 3, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Core-team salvage (@teknium1) folding #50685 (@suninrain086) and #53754 (@liuhao1024) with authorship preserved. Supersedes the sibling-gap cluster #43254/#43251 and overlaps #57286/#43297 (runtime-first approach preferred over #43297's config-read). Related, not duplicate — this is the canonical version; the salvaged/competing PRs (#50685, #53754, #43254, #57286, #43297) can be closed in its favor by a maintainer.

suninrain086 and others added 4 commits July 3, 2026 03:43
A custom:<name> main provider resolves at runtime to the bare provider id
"custom". In the vision auto-detect chain, the main-provider branch called
resolve_provider_client("custom", ...) WITHOUT explicit_base_url/api_key,
so it returned (None, None) ("no endpoint credentials found") and the whole
chain fell through to OpenRouter/Nous. A user on a custom endpoint with no
aggregator configured then got "No LLM provider configured for task=vision
provider=auto" on every image, even though their main model fully supports
vision.

Recover the live endpoint that set_runtime_main() records each turn
(_RUNTIME_MAIN_BASE_URL/_API_KEY/_API_MODE) and forward it to Step 1, with
a fallback to _resolve_custom_runtime() for non-gateway callers. Mirrors the
existing explicit-base_url branch directly above.

Adds TestResolveVisionCustomProvider covering custom, custom:<name>, and the
no-runtime fallback path.
_handlers for vision_analyze and video_analyze read model name from
config.yaml (auxiliary.vision.model / auxiliary.video.model) before
falling back to AUXILIARY_VISION_MODEL / AUXILIARY_VIDEO_MODEL env
vars.  Matches the existing config-first pattern for timeout and
temperature in the same file.

Fixes #53749
…ision_analyze

The salvaged tests from #53754 predate _handle_vision_analyze becoming
async and the native fast path; await the handler and force the legacy
aux path so the model-resolution assertion is actually exercised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists tool/vision Vision analysis and image generation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vision_analyze tool reads aux model from env var, not config.yaml auxiliary.vision.model

4 participants