hermes-agent/agent
Teknium 0ddc8aba68 fix(fallback): let custom_providers shadow built-in aliases
When a user defines `custom_providers: [{name: kimi, ...}]` and references
`provider: kimi` from fallback_model or the main config, the built-in alias
rewriting (`kimi` → `kimi-coding`) was hijacking the request before the
named-custom lookup ran.  `_get_named_custom_provider` also refused to
return a match when the raw name resolved to any built-in (including aliases),
so the custom endpoint was unreachable.

Fix at both layers of the resolution chain so every caller benefits, not
just `_try_activate_fallback`:

- hermes_cli/runtime_provider.py: narrow `_get_named_custom_provider`'s
  built-in-wins guard to canonical provider names only.  An alias like
  `kimi` that resolves to a different canonical (`kimi-coding`) no longer
  blocks the custom lookup; a canonical name like `nous` still does.

- agent/auxiliary_client.py: in `resolve_provider_client`, try the named-
  custom lookup with the original (pre-alias-normalization) name before the
  alias-normalized one, so aliased requests reach the user's custom entry.
  Also honour `explicit_base_url` and `explicit_api_key` in the API-key
  provider branch so callers that pass explicit hints (e.g. fallback
  activation) can override the registered defaults.

Tests added for:
- custom `kimi` shadowing built-in alias (regression for #15743)
- custom `nous` NOT shadowing canonical built-in (behaviour preserved)
- bare `kimi` without any custom entry still routing to built-in
- explicit base_url/api_key override on the API-key provider branch

Original PR #17827 by @Feranmi10 identified the same bug class and
implemented a narrower fix in `_try_activate_fallback`; this reshapes the
fix to live in the shared resolution layer so all callers benefit.

Fixes #15743
Co-authored-by: Feranmi10 <89228157+Feranmi10@users.noreply.github.com>
2026-04-30 20:18:44 -07:00
..
transports fix(deepseek): preserve v4 reasoning_content on replay 2026-04-30 11:18:39 -07:00
__init__.py
…
account_usage.py
…
anthropic_adapter.py
…
auxiliary_client.py fix(fallback): let custom_providers shadow built-in aliases 2026-04-30 20:18:44 -07:00
bedrock_adapter.py
…
codex_responses_adapter.py
…
context_compressor.py fix(context_compressor): off-by-one in tail protection for short conversations 2026-04-30 20:00:01 -07:00
context_engine.py
…
context_references.py
…
copilot_acp_client.py
…
credential_pool.py
…
credential_sources.py
…
curator.py fix(curator): preserve last_report_path in state 2026-04-30 19:45:59 -07:00
display.py
…
error_classifier.py
…
file_safety.py
…
gemini_cloudcode_adapter.py
…
gemini_native_adapter.py
…
gemini_schema.py
…
google_code_assist.py
…
google_oauth.py
…
image_gen_provider.py
…
image_gen_registry.py
…
image_routing.py
…
insights.py
…
lmstudio_reasoning.py
…
manual_compression_feedback.py
…
memory_manager.py
…
memory_provider.py
…
model_metadata.py fix(context): honor model.context_length for Ollama num_ctx and all display paths 2026-04-30 04:31:23 -07:00
models_dev.py
…
moonshot_schema.py
…
nous_rate_guard.py
…
onboarding.py
…
prompt_builder.py feat(kanban): durable multi-profile collaboration board (#17805) 2026-04-30 13:36:47 -07:00
prompt_caching.py
…
rate_limit_tracker.py
…
redact.py
…
retry_utils.py
…
shell_hooks.py
…
skill_commands.py fix(skills): wire bump_use() into skill invocation and preload paths (#17782) 2026-04-30 05:07:34 -07:00
skill_preprocessing.py
…
skill_utils.py fix(skills): exclude .archive from skill index walk 2026-04-30 04:59:22 -07:00
subdirectory_hints.py
…
title_generator.py
…
trajectory.py
…
usage_pricing.py
…