mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(agent): default missing fallback chain on switch
This commit is contained in:
parent
46451528a5
commit
a9fd8d7c88
2 changed files with 16 additions and 3 deletions
|
|
@ -78,6 +78,17 @@ def test_switch_with_empty_chain_stays_empty():
|
|||
assert agent._fallback_model is None
|
||||
|
||||
|
||||
def test_switch_initializes_missing_fallback_attrs():
|
||||
agent = _make_agent([])
|
||||
del agent._fallback_chain
|
||||
del agent._fallback_model
|
||||
|
||||
_switch_to_anthropic(agent)
|
||||
|
||||
assert agent._fallback_chain == []
|
||||
assert agent._fallback_model is None
|
||||
|
||||
|
||||
def test_switch_within_same_provider_preserves_chain():
|
||||
chain = [{"provider": "openrouter", "model": "x-ai/grok-4"}]
|
||||
agent = _make_agent(chain)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue