Skip to content

Conversation

@ahosker
Copy link
Contributor

@ahosker ahosker commented Dec 20, 2025

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

@rekram1-node
Copy link
Collaborator

/review

@ahosker
Copy link
Contributor Author

ahosker commented Dec 20, 2025

Committed the type safety fixes.

@rekram1-node
Copy link
Collaborator

/review

return null
}
return [providerID, sorted[0].id]
})
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@github-actions
Copy link
Contributor

lgtm

@ahosker
Copy link
Contributor Author

ahosker commented Jan 9, 2026

Too told, too many changes since this was written.

@ahosker ahosker closed this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: undefined is not an object crash on start after v1.0.180 update

2 participants