[codex] fix TUI fallback providers for dflash empty responses - #36056
[codex] fix TUI fallback providers for dflash empty responses#36056OmarB97 wants to merge 1 commit into
Conversation
Review Summary: APPROVE ✓Focused, correct fix for the TUI dflash empty-response regression. The change is minimal (3 lines of production code + 2 targeted tests) and addresses the root cause: background agents in the TUI gateway were receiving only the first fallback provider instead of the full chain. What the PR does
Correctness analysisVerified against Edge cases handled:
Verification
Non-blocking suggestions
|
|
Obsolete: upstream 4b073d0 independently implemented the identical TUI fallback-provider fix with strictly more coverage (_load_fallback_model + _agent_fallback_model incl. the empty-chain nuance, 102 test lines). Nothing here is lost on main. Closing. |
What changed
fallback_providers/ legacyfallback_modelconfig in TUI gateway session creation.AIAgent, matching oneshot CLI behavior._fallback_model.Root cause
TUI sessions ignored the configured fallback chain when constructing
AIAgent. In localtaro/dflashsessions, dflash can occasionally return an empty post-tool response. Hermes then retried the same context but had no fallback available in TUI, despite fallbacks being present in config, so the user saw a terminalNo replyresult.Impact
TUI behavior now matches oneshot CLI: if the primary model repeatedly returns empty output, the configured fallback chain can activate instead of ending the turn with no recovery path.
Validation
python3 -m pytest tests/test_tui_gateway_server.py -q -k "make_agent or background_agent_kwargs"python3 -m pytest tests/run_agent/test_run_agent.py -q -k empty_responsepython3 -m pytest tests/run_agent/test_provider_fallback.py tests/cli/test_cli_init.py -q_make_agent()passes the configured fallback chain.hermes-phonetmux session was restarted after deploying the patched gateway file to the installed taro checkout.Notes
The full local
tests/test_tui_gateway_server.py -qrun had one unrelated environment-dependent browser-launch expectation failure on this Mac; the fallback-focused tests passed.Fork mirror: OmarB97#47