Commit d2c4a03
fix: use model_id without provider prefix when loading settings (#280)
* fix: use model_id without provider prefix when loading settings
When loading settings in basic mode, the model_select dropdown was being
set 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 caused an InvalidSelectValueError when
opening the settings screen with a previously configured model.
The fix uses the model variable (extracted from splitting llm.model by '/')
instead of the full llm.model string when setting model_select.value.
Also updated the test to reflect the correct behavior where model options
don't include the provider prefix.
Co-authored-by: openhands <openhands@all-hands.dev>
* fix: shorten long comments to pass linter
---------
Co-authored-by: openhands <openhands@all-hands.dev>1 parent ce1b108 commit d2c4a03
2 files changed
Lines changed: 7 additions & 4 deletions
File tree
- openhands_cli/tui/modals/settings
- tests/refactor/modals/settings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | | - | |
137 | | - | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
0 commit comments