Skip to content

fix(setup): remove dead code causing is_coding_plan NameError crash - #1123

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/setup-is-coding-plan-nameError
Mar 13, 2026
Merged

fix(setup): remove dead code causing is_coding_plan NameError crash#1123
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/setup-is-coding-plan-nameError

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes 50 lines of dead/duplicate model selection code in setup_model_provider() that referenced an undefined is_coding_plan variable, causing a NameError crash when selecting zai, kimi-coding, minimax, or minimax-cn providers
  • The existing _setup_provider_model_selection() function already handles all these providers correctly via _DEFAULT_PROVIDER_MODELS dict — the removed code was leftover from before this generic function was introduced
  • Adds 6 regression tests covering default model fallback, live model detection, and custom model selection for all affected providers

Removed dead code

The removed block (lines 1246-1295) contained:

  1. is_coding_plan — never defined in setup_model_provider() scope, crashes with NameError
  2. Duplicate ZAI model list — already in _DEFAULT_PROVIDER_MODELS["zai"]
  3. Unreachable elif branches for kimi-coding and minimax — already caught by the parent condition

Test plan

  • 4 parametrized tests: zai, kimi-coding, minimax, minimax-cn providers work without crash and show correct default models
  • 1 test: live API models are used when available
  • 1 test: custom model selection works correctly
  • All 6 tests pass

Remove 50 lines of unreachable duplicate model selection logic in
setup_model_provider() for zai/kimi-coding/minimax/minimax-cn providers.
The code referenced undefined `is_coding_plan` variable, crashing setup.
_setup_provider_model_selection() already handles these providers correctly
via _DEFAULT_PROVIDER_MODELS dict.
@teknium1
teknium1 merged commit e53dfd8 into NousResearch:main Mar 13, 2026
1 check failed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…plan-nameError

Clean fix — removes dead code that crashed with NameError on is_coding_plan. The generic _setup_provider_model_selection() already handles all affected providers.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…plan-nameError

Clean fix — removes dead code that crashed with NameError on is_coding_plan. The generic _setup_provider_model_selection() already handles all affected providers.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…plan-nameError

Clean fix — removes dead code that crashed with NameError on is_coding_plan. The generic _setup_provider_model_selection() already handles all affected providers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants