Bug Description
When using Hermes via ACP (Obsidian Agent Client, VS Code, JetBrains, Zed, etc.), the fallback_providers configured in config.yaml are never passed to AIAgent(). This means when the primary model encounters an error (rate limit, overload, auth failure), the agent cannot automatically switch to a configured fallback provider — it just fails.
The CLI and gateway both correctly read fallback_providers from config and pass them to AIAgent(fallback_model=...), but the ACP adapter does not.
Reproduction
- Configure
fallback_providers in ~/.hermes/config.yaml:
fallback_providers:
- model: glm-5-turbo
provider: zhipu
- model: qwen3.6-plus
provider: bailian
- Set primary model to a provider that may error (e.g. during peak hours)
- Connect via Obsidian Agent Client (ACP)
- When primary model errors, observe that fallback does NOT activate — session fails instead
Root Cause
In acp_adapter/session.py, _make_agent() builds the kwargs dict for AIAgent() but never includes fallback_model. Compare:
- CLI (
cli.py:2106-2110): reads fallback_providers from config, passes as fallback_model=self._fallback_model to AIAgent()
- Gateway (
gateway/session.py): also passes fallback_model
- ACP (
acp_adapter/session.py:565-597): kwargs has no fallback_model key at all
Result: AIAgent.__init__ sets self._fallback_chain = [] and self._fallback_index = 0, so error_classifier.py correctly flags should_fallback=True but the main loop has no fallback chain to iterate over.
Fix
Add fallback_providers loading in acp_adapter/session.py _make_agent(), right before the session_db assignment:
# Pass fallback_providers from config so ACP agents can fail over
# when the primary model errors (same as CLI does in cli.py).
try:
fb = config.get("fallback_providers") or config.get("fallback_model") or []
if isinstance(fb, dict):
fb = [fb] if fb.get("provider") and fb.get("model") else []
if fb:
kwargs["fallback_model"] = fb
except Exception:
logger.debug("Could not load fallback_providers for ACP agent", exc_info=True)
Environment
- Hermes version: v0.10.2+
- Platform: ACP (any editor integration)
- All providers affected
Bug Description
When using Hermes via ACP (Obsidian Agent Client, VS Code, JetBrains, Zed, etc.), the
fallback_providersconfigured inconfig.yamlare never passed toAIAgent(). This means when the primary model encounters an error (rate limit, overload, auth failure), the agent cannot automatically switch to a configured fallback provider — it just fails.The CLI and gateway both correctly read
fallback_providersfrom config and pass them toAIAgent(fallback_model=...), but the ACP adapter does not.Reproduction
fallback_providersin~/.hermes/config.yaml:Root Cause
In
acp_adapter/session.py,_make_agent()builds the kwargs dict forAIAgent()but never includesfallback_model. Compare:cli.py:2106-2110): readsfallback_providersfrom config, passes asfallback_model=self._fallback_modeltoAIAgent()gateway/session.py): also passesfallback_modelacp_adapter/session.py:565-597):kwargshas nofallback_modelkey at allResult:
AIAgent.__init__setsself._fallback_chain = []andself._fallback_index = 0, soerror_classifier.pycorrectly flagsshould_fallback=Truebut the main loop has no fallback chain to iterate over.Fix
Add fallback_providers loading in
acp_adapter/session.py_make_agent(), right before thesession_dbassignment:Environment