I’m having trouble configuring cerebras as model p...
# general
i
I’m having trouble configuring cerebras as model provider. I start the CLI (v1.7.0) from scratch (no previously existing agent_settings.json) and configure with the basic wizard. I have configured cerebras/zai-glm-4.6, but the conversation just permaloads. If I restart and go to palette->settings to review the config, the CLI closes with the following message:
InvalidSelectValueError: Illegal select value 'cerebras/zai-glm-4.6'.
l
@nutritious-balloon-65098 understand how InvalidSelectValueError may happen and understand why this might be failing. You may need to look at what providers are provided by litellm for cerebras to debug
n
I'm on it! Graham Neubig can track my progress here.
Summary I investigated and fixed the
InvalidSelectValueError: Illegal select value 'cerebras/zai-glm-4.6'
bug in the OpenHands CLI. Root Cause Analysis The bug occurs in
settings_screen.py
when loading existing settings in basic mode: 1. How models are stored: The full model string with provider prefix (e.g.,
cerebras/zai-glm-4.6
) is stored in the settings 2. How dropdown options are populated: The
get_model_options()
function returns model IDs WITHOUT the provider prefix (e.g.,
zai-glm-4.6
) 3. The bug: When loading settings, the code was setting
self.model_select.value = llm.model
(the full string
cerebras/zai-glm-4.6
), but the dropdown only contains
zai-glm-4.6
as a valid option This caused Textual's Select widget to throw
InvalidSelectValueError
because the value didn't match any available option. Fix Applied File:
openhands_cli/tui/modals/settings/settings_screen.py
• Changed line 177 from
self.model_select.value = llm.model
to
self.model_select.value = model
• The
model
variable already contains just the model ID (extracted earlier via
provider, model = llm.model.split("/", 1)
) File:
tests/refactor/modals/settings/test_settings_screen.py
• Updated the test to reflect the correct behavior where model options don't include the provider prefix Verification • All 55 tests in the settings module pass ✅ Checklist - [ ] Root cause identified and understood - [ ] Fix is minimal and targeted - [ ] Test updated to reflect correct behavior - [ ] All tests pass - [ ] Changes committed locally ------------------------- Would you like me to: 1. Push the changes to a new branch and create a pull request? 2. Keep the changes local for now? 3. Any other Git workflow you prefer? View full conversation
l
@nutritious-balloon-65098 yes please create a draft PR, and once you do that run the CLI locally to make sure that this fixes the problem in the live code too.
n
I'm on it! Graham Neubig can continue tracking my progress here.
Summary I investigated and fixed the
InvalidSelectValueError
bug that occurs when opening settings in OpenHands-CLI v1.7.0 after configuring a cerebras model. Root Cause When loading settings in basic mode, the code was setting
model_select.value
to the full model string (e.g.,
cerebras/zai-glm-4.6
), but the dropdown options only contain model IDs without the provider prefix (e.g.,
zai-glm-4.6
). This mismatch caused the
InvalidSelectValueError
. Fix Applied Changed line 177 in
settings_screen.py
from:
Copy code
self.model_select.value = llm.model  # "cerebras/zai-glm-4.6"
to:
Copy code
self.model_select.value = model  # "zai-glm-4.6"
Verification 1. ✅ All 55 tests pass 2. ✅ Live verification script confirmed the fix works with
cerebras/zai-glm-4.6
model Changes Made •
openhands_cli/tui/modals/settings/settings_screen.py
- Fixed the bug •
tests/refactor/modals/settings/test_settings_screen.py
- Updated test to reflect correct behavior Unable to Create PR I was unable to push to GitHub and create a PR because there's no
GITHUB_TOKEN
environment variable available in this environment. The changes are committed locally on branch
fix/model-select-invalid-value
. To create the PR manually, you can: 1. Clone the repo and apply this patch, or 2. Provide a GitHub token so I can push and create the PR The commit is ready with message:
Copy code
fix: use model_id without provider prefix when loading settings
Would you like me to provide the patch file, or can you provide GitHub credentials to push the changes? View full conversation
Summary I've successfully identified and fixed the
InvalidSelectValueError
bug in OpenHands-CLI and created a draft PR. Root Cause When loading settings in basic mode,
_load_current_settings()
was setting
model_select.value
to the full model string (e.g.,
cerebras/zai-glm-4.6
), but the dropdown options from
get_model_options()
only contain model IDs without the provider prefix (e.g.,
zai-glm-4.6
). This caused the Textual Select widget to throw
InvalidSelectValueError
. Fix Changed line 177 in
settings_screen.py
to use the
model
variable (already extracted from splitting
llm.model
by
/
) instead of the full
llm.model
string:
Copy code
# Before (buggy):
self.model_select.value = llm.model  # "cerebras/zai-glm-4.6"

# After (fixed):
self.model_select.value = model  # "zai-glm-4.6"
Verification • ✅ All 55 existing tests pass • ✅ Updated test to correctly reflect actual
get_model_options()
behavior • ✅ Manually verified fix works with simulated
cerebras/zai-glm-4.6
configuration • ✅ Changes are minimal and focused (only 2 files changed, +7/-4 lines) Draft PR Created https://github.com/OpenHands/OpenHands-CLI/pull/280 ------------------------- How to Test This PR Using uvx Users can test this fix directly from the PR branch using `uvx`:
Copy code
# Install and run the CLI directly from the PR branch
uvx --from "git+<https://github.com/OpenHands/OpenHands-CLI.git@fix/model-select-invalid-value>" openhands

# Or if you want to specify the package name explicitly
uvx --from "openhands-cli @ git+<https://github.com/OpenHands/OpenHands-CLI.git@fix/model-select-invalid-value>" openhands
To reproduce the original bug and verify the fix: 1. Configure the CLI with
cerebras/zai-glm-4.6
using the basic wizard 2. Restart the CLI 3. Open the command palette and go to Settings 4. Before fix: CLI crashes with
InvalidSelectValueError: Illegal select value 'cerebras/zai-glm-4.6'
5. After fix: Settings screen opens correctly with the model dropdown showing
zai-glm-4.6
selected View full conversation
l
Hey @important-diamond-63626, sorry about this, there was a bug. I have confirmed that the above fix works though, you can try to run with the uvx command that openhands cited above.
i
I can confirm it works too, @limited-student-10747, thanks
🙌 1