Remove OpenRouter Models by Provider backup#887
Conversation
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (9 files)
|
| if (!response.ok) { | ||
| console.error(`Failed to fetch: ${response.status} ${response.statusText}`); | ||
| return await parseModelsByProviderBackupData(); | ||
| throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`); |
There was a problem hiding this comment.
WARNING: This still degrades to an empty provider/model state in the current UI
Throwing here makes React Query enter the error state, but useOpenRouterModelsAndProviders() still derives models and providers from query.data and returns [] when the fetch fails. The current callers only read those arrays or isLoading (OrganizationProvidersAndModelsPage, OrganizationProvidersAndModelsConfigurationCard, CondensedProviderAndModelsList), so once the backup is removed the missing-snapshot case will still look like a genuine "0 providers / 0 models" state instead of an actionable failure.
instead tell local users to run the script