fix: update ollama provider type and increment store version to 190

- Changed ollama provider type from 'openai' to 'ollama' in SYSTEM_PROVIDERS_CONFIG.
- Incremented persisted reducer version from 189 to 190.
- Added migration logic for version 190 to update existing provider types in state.
This commit is contained in:
kangfenmao 2025-12-26 11:44:30 +08:00
parent 4ae9bf8ff4
commit 0f0e18231d
3 changed files with 17 additions and 2 deletions

View File

@ -289,7 +289,7 @@ export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> =
ollama: {
id: 'ollama',
name: 'Ollama',
type: 'openai',
type: 'ollama',
apiKey: '',
apiHost: 'http://localhost:11434',
models: SYSTEM_MODELS.ollama,

View File

@ -67,7 +67,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 189,
version: 190,
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs', 'toolPermissions'],
migrate
},

View File

@ -3098,6 +3098,21 @@ const migrateConfig = {
logger.error('migrate 189 error', error as Error)
return state
}
},
// 1.7.8
'190': (state: RootState) => {
try {
state.llm.providers.forEach((provider) => {
if (provider.id === SystemProviderIds.ollama) {
provider.type = 'ollama'
}
})
logger.info('migrate 190 success')
return state
} catch (error) {
logger.error('migrate 190 error', error as Error)
return state
}
}
}