Files
hermes-agent/agent
RelaxJonh 4ee2c78324 fix(agent): Kimi Code fallbacks use the Anthropic Messages wire (#77256)
`try_activate_fallback` derived the fallback api_mode with its own host
heuristic (api.anthropic.com / trailing `/anthropic`) that lagged the
primary path's `_detect_api_mode_for_url()`: a `fallback_providers` entry
pointing at `api.kimi.com/coding` activated but POSTed OpenAI-shaped
`/chat/completions`, which that endpoint 404s, so every fallback turn
failed after the chain had correctly switched.

Route `_is_anthropic_wire_url` through `providers.host_mandated_api_mode`
— the single Messages-only host table the primary path already uses — so
the fallback path can never drift from it again. Exact-hostname match
rejects `api.kimi.com.attacker.test`.

Salvaged from #77304 by @RelaxJonh (original detection branch).
2026-09-05 15:54:14 +05:30
..