Skip to content

fix(agent): resolve custom: prefix in vision provider before normalisation - #44398

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/aux-vision-custom-prefix-resolution
Closed

fix(agent): resolve custom: prefix in vision provider before normalisation#44398
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/aux-vision-custom-prefix-resolution

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes auxiliary.vision.provider: custom:<name> collapsing to the bare built-in provider when <name> matches a built-in (e.g. custom:minimaxminimax). The user's custom_providers entry was never consulted, causing 401 on the wrong endpoint.

Related Issue

Fixes #44349

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • agent/auxiliary_client.py: In resolve_vision_provider_client, save the raw provider before _normalize_vision_provider strips the custom: prefix. When the raw name starts with custom:, try _get_named_custom_provider(raw) before falling through to general dispatch. This ensures the user's custom_providers entry is found.
  • tests/agent/test_auxiliary_named_custom_providers.py: 3 new tests — custom prefix resolves to named provider, unknown custom prefix returns None, custom prefix matches providers: dict format.

How to Test

  1. Set custom_providers: [{name: minimax, base_url: http://custom.local/v1, api_key: k}] in config.yaml
  2. Set auxiliary.vision.provider: custom:minimax
  3. Call resolve_vision_provider_client("custom:minimax") — should use the custom endpoint, not built-in minimax
  4. Run pytest tests/agent/test_auxiliary_named_custom_providers.py -xvs — all 32 tests pass

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Code Intelligence

⚠️ GitNexus unavailable — grep-based fallback used.

…ation

When auxiliary.vision.provider is set to `custom:<name>` where <name>
matches a built-in provider (e.g. `custom:minimax`), _normalize_aux_provider
strips the `custom:` prefix before the named custom provider lookup,
collapsing it to the bare built-in provider.  The user's custom_providers
entry is never consulted, causing 401 on the wrong endpoint.

Fix: save the raw requested provider before normalisation in
resolve_vision_provider_client and try _get_named_custom_provider with the
raw `custom:<name>` before falling through to general dispatch.

Fixes NousResearch#44349
@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 P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #13781 — same root cause and approach (preserve custom: prefix so named custom_providers resolve before normalisation). #13781 is the canonical earliest-open PR; the closed twin #44361 was already marked a duplicate of it.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Thanks for the flag @alt-glitch. Comparing the two PRs:

This PR provides more comprehensive coverage with tests and addresses the vision provider path that #13781 doesn't cover. Keeping open.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Thanks for flagging @alt-glitch. Comparing the two PRs:

This PR includes regression tests verifying custom provider resolution. Keeping open for the more complete fix.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #13781 by @ms-alan, which implements the same fix (preserving custom: prefix in _normalize_aux_provider). That PR was opened earlier (2026-04-22) with the same root cause and approach.

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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have 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.

auxiliary.vision.provider="custom:xxx" collapses to bare built-in, ignores custom_providers (causes 401)

2 participants