opencode
opencode copied to clipboard
fix: handle providers with no available models to prevent crashes
Summary
- Fix runtime crashes when providers have no available models
- Add validation in provider merge process
- Prevent empty model arrays from breaking ACP agent functionality
- Graceful degradation with error logging for debugging
Fixes
- Prevents crashes in model selection dialogs
- Handles edge cases in provider configuration merges
- Improves error handling in server API endpoints
Test
OpenCode continues to work against the earlier failed models.json (attatched)
models_broken.json
Closes #5858
/review
Committed the type safety fixes.
/review
lgtm