hermes - 💡(How to fix) Fix TUI: fallback_providers not passed to AIAgent (CLI works correctly)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…

In the classic CLI, fallback_providers from config.yaml is correctly read and passed to AIAgent, enabling automatic failover when the primary provider fails.

However, in the TUI (hermes --tui), the fallback chain is never initialized — the _make_agent function in tui_gateway/server.py does not read fallback_providers from config and does not pass fallback_model= to the AIAgent constructor.

Root Cause

CLI (cli.py line 3142):

self._fallback_model = get_fallback_chain(CLI_CONFIG)

...later passed to AIAgent(fallback_model=self._fallback_model) at line 4984. Both steps are correct.

TUI (tui_gateway/server.py _make_agent, line 1999-2053):

cfg = _load_cfg()  # fallback_providers never read
# ...
return AIAgent(
    model=model,
    provider=runtime.get("provider"),
    base_url=runtime.get("base_url"),
    api_key=runtime.get("api_key"),
    api_mode=runtime.get("api_mode"),
    # fallback_model=...  ← MISSING
)

get_fallback_chain() from hermes_cli.fallback_config is never imported or called in the TUI code path.

Code Example

self._fallback_model = get_fallback_chain(CLI_CONFIG)

---

cfg = _load_cfg()  # fallback_providers never read
# ...
return AIAgent(
    model=model,
    provider=runtime.get("provider"),
    base_url=runtime.get("base_url"),
    api_key=runtime.get("api_key"),
    api_mode=runtime.get("api_mode"),
    # fallback_model=...MISSING
)

---

fallback_providers:
  - provider: custom:nvidia-openclaw
    model: minimaxai/minimax-m2.7
  - provider: custom:nvidia-mei
    model: minimaxai/minimax-m2.7
RAW_BUFFERClick to expand / collapse

Description

In the classic CLI, fallback_providers from config.yaml is correctly read and passed to AIAgent, enabling automatic failover when the primary provider fails.

However, in the TUI (hermes --tui), the fallback chain is never initialized — the _make_agent function in tui_gateway/server.py does not read fallback_providers from config and does not pass fallback_model= to the AIAgent constructor.

Root cause

CLI (cli.py line 3142):

self._fallback_model = get_fallback_chain(CLI_CONFIG)

...later passed to AIAgent(fallback_model=self._fallback_model) at line 4984. Both steps are correct.

TUI (tui_gateway/server.py _make_agent, line 1999-2053):

cfg = _load_cfg()  # fallback_providers never read
# ...
return AIAgent(
    model=model,
    provider=runtime.get("provider"),
    base_url=runtime.get("base_url"),
    api_key=runtime.get("api_key"),
    api_mode=runtime.get("api_mode"),
    # fallback_model=...  ← MISSING
)

get_fallback_chain() from hermes_cli.fallback_config is never imported or called in the TUI code path.

Expected behavior

TUI should behave identically to CLI with respect to fallback_providers — when the primary model/provider fails after retries, Hermes should automatically try the configured fallback providers in order.

Additional context

Config used (CLI works, TUI does not):

fallback_providers:
  - provider: custom:nvidia-openclaw
    model: minimaxai/minimax-m2.7
  - provider: custom:nvidia-mei
    model: minimaxai/minimax-m2.7

The same config enables fallback switching in CLI immediately. The TUI ignores it entirely.

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…

FAQ

Expected behavior

TUI should behave identically to CLI with respect to fallback_providers — when the primary model/provider fails after retries, Hermes should automatically try the configured fallback providers in order.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING