-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ambiguous model id error #4306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
871637c to
056eca6
Compare
|
will fix lint errors in a bit, not in front of computer rn, somehow it didn't catch on earlier on my machine |
|
brought back glama since #4269 is closed, this PR should be ready to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @elianiva, Thank you for taking this issue! Sorry that it took so long to review your contribution!
I reviewed your PR and left some questions, I would like to know what you think.
I also tested the implementation and I see that while a default model is selected when I enter a non-existent model, the model I entered is persisted while the default is not:
2025-06-07.09-54-34.mp4
Might be worth taking a look.
c8e1dce to
004cb26
Compare
89faa67 to
836a519
Compare
|
i've addressed the comments, i ended up removing the |
|
Just a heads up, I've addressed all the change requests, so this PR should be labeled |
|
Hey @elianiva, I might be doing something wrong here but the invalid model is not resetting when switching providers. 2025-06-14_14-10-20.mp4Is this intended? |
Yes, I decided to remove it based on your previous feedback. I thought it was a good idea at first, but then decided to let it be invalid so the users know and then fix it themselves. It's better to have this behaviour rather than implicitly reset the model. That behaviour might leave users questioning "why this model got reset" without further explanation. |
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| } | ||
| break | ||
| > | ||
| > = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably pull this out into a constant and strengthen the typing using this: https://github.com/RooCodeInc/Roo-Code/blob/main/packages/types/src/provider-settings.ts#L263
cte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
Related GitHub Issue
Closes: #2577
Description
Previously the model id error displayed is a bit ambiguous since it is placed below the provider selector, making users confused which input is actually needs correction. This PR puts the error message where it is more relevant.
There was also an issue where if you change the provider, the invalid one will still get selected. This PR makes it so that invalid values get reset into empty.
Test Procedure
Added some unit tests and tested it manually.
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Before:
After:
Important
Improves error message placement and handling of invalid model selections in model configuration components.
ModelPickerto be more contextually relevant.ApiOptions.ModelPickerto display error messages below the model selector.ApiOptionsto usevalidateApiConfigurationExcludingModelErrors()andgetModelValidationError().Glama.tsx,LiteLLM.tsx,OpenAICompatible.tsx,OpenRouter.tsx,Requesty.tsx,Unbound.tsx) to passmodelValidationErrortoModelPicker.ModelPicker.test.tsxfor error message display.validate.test.tsfor new validation functions.getModelValidationError()andvalidateApiConfigurationExcludingModelErrors()invalidate.tsto separate model-specific errors from general API configuration errors.This description was created by
for e27109e. You can customize this summary. It will automatically update as commits are pushed.