Skip to content

fix: default missing fallback state in switch_model#14867

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/minimax-switch-model-fallback-14864
Closed

fix: default missing fallback state in switch_model#14867
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/minimax-switch-model-fallback-14864

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • default switch_model fallback state when minimal agent fixtures omit _fallback_chain
  • keep provider-switch fallback pruning behavior unchanged for initialized agents
  • add a regression test covering the missing-fallback-attrs path

Testing

  • python3 -m pytest -o addopts= tests/agent/test_minimax_provider.py::TestMinimaxSwitchModelCredentialGuard::test_switch_to_minimax_does_not_resolve_anthropic_token tests/run_agent/test_switch_model_fallback_prune.py

Closes #14864

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the fix, @LeonSGP43! This change has already landed on main — the commit was applied directly to the branch.

Automated hermes-sweeper review.

  • The defensive getattr(self, '_fallback_chain', []) or [] is at run_agent.py:2201 (commit a9fd8d7).
  • The regression test test_switch_initializes_missing_fallback_attrs is present in tests/run_agent/test_switch_model_fallback_prune.py lines 81–90, identical to the test in this PR.
  • The diff from gh pr diff 14867 matches the committed patch byte-for-byte.

Closing as implemented on main.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiniMax switch_model credential guard test crashes on missing _fallback_chain

3 participants