hermes - 💡(How to fix) Fix Bug: vision fallback_chain silently broken — wrong kwargs in _resolve_single_provider

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

When the primary vision provider (e.g. Gemini) returns 429/402, the configured auxiliary.vision.fallback_chain entries are skipped due to this TypeError, and the error propagates directly to the user instead of trying the configured fallback providers. After the fix, _try_configured_fallback_chain('vision', 'gemini', 'payment error') correctly returns an OpenAI client with model mimo-v2-omni via fallback_chain[0](Xiaomi-TP).

Fix Action

Fix

# Before (broken):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    base_url=base_url,
    api_key=api_key,
)

# After (fixed):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    explicit_base_url=base_url,
    explicit_api_key=api_key,
)

Code Example

# Before (broken):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    base_url=base_url,
    api_key=api_key,
)

# After (fixed):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    explicit_base_url=base_url,
    explicit_api_key=api_key,
)
RAW_BUFFERClick to expand / collapse

Bug

_resolve_single_provider() (line 2652) passes base_url and api_key to resolve_provider_client(), but that function expects explicit_base_url and explicit_api_key. This causes a TypeError that is silently swallowed, returning None for the client — so the entire configured fallback_chain for auxiliary tasks (vision, etc.) never fires.

Impact

When the primary vision provider (e.g. Gemini) returns 429/402, the configured auxiliary.vision.fallback_chain entries are skipped due to this TypeError, and the error propagates directly to the user instead of trying the configured fallback providers.

Reproduction

  1. Configure auxiliary.vision.fallback_chain with a valid provider (e.g. Xiaomi-TP)
  2. Primary provider (Gemini) returns 429
  3. Fallback chain silently fails — no fallback attempt

Fix

# Before (broken):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    base_url=base_url,
    api_key=api_key,
)

# After (fixed):
client, resolved_model = resolve_provider_client(
    provider=provider,
    model=model,
    explicit_base_url=base_url,
    explicit_api_key=api_key,
)

Verified

After the fix, _try_configured_fallback_chain('vision', 'gemini', 'payment error') correctly returns an OpenAI client with model mimo-v2-omni via fallback_chain[0](Xiaomi-TP).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING