fix(tui): wire fallback provider chain into desktop GUI / TUI / dashboard chat (salvage #18310)#42625
Merged
Conversation
Follow-up to the salvaged fallback-chain fix: - Replace the hand-rolled fallback loader with the shared hermes_cli.fallback_config.get_fallback_chain() helper so the TUI path matches HermesCLI and gateway/run.py exactly: fallback_providers stays first and keeps order, with distinct legacy fallback_model entries merged in after (deduped). Previously the TUI loader picked one key OR the other, diverging from CLI/gateway when both were set. - Update the test to assert the merged canonical semantics. - Add psionic73 to scripts/release.py AUTHOR_MAP (CI gate).
Contributor
🔎 Lint report:
|
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Desktop GUI,
hermes --tui, and the embedded dashboard chat now respect the configuredfallback_providers/fallback_modelchain — previously they silently had an empty fallback chain and a turn would fail on the primary instead of failing over.Salvages #18310 (@psionic73) onto current
main, where_make_agenthas since gained amodel_overrideparameter.Root cause
tui_gateway/server.py::_make_agent()built the chatAIAgentwithout passingfallback_model=, soagent._fallback_chainended up[]for every TUI-backed session (desktop GUI, Ink TUI, dashboard/chat). The CLI (cli.py) and the messaging gateway (gateway/run.py) both wire this correctly; only thetui_gatewaypath was missed. A second-order bug:_background_agent_kwargs()propagated fallback viagetattr(agent, "_fallback_model", None), which was alwaysNonebecause the foreground agent never had it set.Fixes #28753.
Changes
tui_gateway/server.py: passfallback_model=_load_fallback_model()into_make_agent;_load_fallback_modeldelegates to the sharedhermes_cli.fallback_config.get_fallback_chain()(parity with CLI/gateway —fallback_providersfirst + legacyfallback_modelmerged in, deduped). Background/preview agents now forward the full_fallback_chaininstead of the legacy single entry.tests/test_tui_gateway_server.py: assert the merged canonical chain semantics.scripts/release.py: add @psionic73 toAUTHOR_MAP(CI gate).Validation
_make_agentagent_fallback_chain(config has chain)[]Nonetests/test_tui_gateway_server.pyAIAgentvia_make_agent, isolatedHERMES_HOME)Original PR: #18310 — cherry-picked with @psionic73's authorship preserved.
Infographic