-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix: handle providers with no available models to prevent crashes #5863
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
|
/review |
|
Committed the type safety fixes. |
|
/review |
| return null | ||
| } | ||
| return [providerID, sorted[0].id] | ||
| }) |
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.
Suggestion (not a violation): This exact logic for generating the default map is duplicated at line 1541. Consider extracting to a helper function for maintainability. That said, keeping it inline is also acceptable if you prefer the explicitness.
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.
Can do, however the style guide says.
Functions: Keep logic within a single function unless breaking it out adds clear reuse or composition benefits.
|
lgtm |
|
Too told, too many changes since this was written. |
Summary
Fixes
Test
OpenCode continues to work against the earlier failed
models.json(attatched)models_broken.json
Closes #5858