From 3d42dde48c99bfa61bf35f5cc6d14884694ac5ee Mon Sep 17 00:00:00 2001 From: Yusheng Guo <113574546+yshngg@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:34:22 +0800 Subject: [PATCH] fix(migrations): skip unhandled AI providers during migration execution The changes: 1. Expanded the skip condition to include additional AI providers (DEEPSEEK, GROQ, MISTRAL, MLX, OPENROUTER) beyond just TEST 2. Maintained existing TEST provider skip behavior 3. Added explicit comment explaining the skip logic The why: Prevents migration execution for unsupported AI providers to avoid potential runtime errors or data inconsistencies, ensuring migrations only run for properly handled configurations. --- src/migrations/_run.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/migrations/_run.ts b/src/migrations/_run.ts index bbf3bb82..30d9fd34 100644 --- a/src/migrations/_run.ts +++ b/src/migrations/_run.ts @@ -36,6 +36,19 @@ export const runMigrations = async () => { const config = getConfig(); if (config.OCO_AI_PROVIDER === OCO_AI_PROVIDER_ENUM.TEST) return; + // skip unhandled providers in migration00 + if ( + [ + OCO_AI_PROVIDER_ENUM.DEEPSEEK, + OCO_AI_PROVIDER_ENUM.GROQ, + OCO_AI_PROVIDER_ENUM.MISTRAL, + OCO_AI_PROVIDER_ENUM.MLX, + OCO_AI_PROVIDER_ENUM.OPENROUTER, + ].includes(config.OCO_AI_PROVIDER) + ) { + return; + } + const completedMigrations = getCompletedMigrations(); let isMigrated = false;