Skip to content

[Bug]auxiliary_client with provider: auto wastes time walking provider chain before reaching custom_providers #25384

@NorethSea

Description

@NorethSea

Bug Description

When auxiliary.session_search.provider is set to auto (the default),
and the environment has no credentials for OpenRouter or Nous Portal, the
auto-detect chain still walks through them sequentially before falling
through to custom_providers. Each failed hop adds unnecessary latency,
and the subsequent fallback retry can hit the same provider again,
compounding the waste.

Steps to Reproduce

  1. Configure a main provider via custom_providers (no OpenRouter or
    Nous API keys)
  2. Leave auxiliary.session_search.provider: auto (default)
  3. Call session_search on sessions that require LLM summarization

What Happens

The auto-detect chain walks:

auto → OpenRouter (no API key, fails) 
    → Nous Portal (no API key, fails) 
    → custom_providers (reaches target provider)
    → API call may timeout
    → fallback retries same provider
    → timeout again
    → repeats up to 3 times

From logs, a single session_search summarization call took ~560 seconds
due to this chain + retry loop. When an off-work wrapup cron reviews
multiple sessions, the cumulative delay is severe.

Expected Behavior

  • If no credentials exist for OpenRouter/Nous, skip them immediately
    rather than attempting and waiting for failure
  • When fallback is triggered because the API timed out, try a genuinely
    different provider instead of the same one
  • Or: provide a config option to explicitly bypass the auto-detect chain
    and go directly to a named provider

Workaround

Explicitly set session_search.provider: custom:<name> in
auxiliary config to skip the auto-detect walk entirely.

Environment

  • Hermes Agent: 0.8.x
  • Main provider: custom_providers
  • Auxiliary affected: session_search

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/agentCore agent loop, run_agent.py, prompt buildertype/perfPerformance improvement or optimization

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions