Skip to content

Commit 3d42dde

Browse files
authored
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.
1 parent c107078 commit 3d42dde

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/migrations/_run.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ export const runMigrations = async () => {
3636
const config = getConfig();
3737
if (config.OCO_AI_PROVIDER === OCO_AI_PROVIDER_ENUM.TEST) return;
3838

39+
// skip unhandled providers in migration00
40+
if (
41+
[
42+
OCO_AI_PROVIDER_ENUM.DEEPSEEK,
43+
OCO_AI_PROVIDER_ENUM.GROQ,
44+
OCO_AI_PROVIDER_ENUM.MISTRAL,
45+
OCO_AI_PROVIDER_ENUM.MLX,
46+
OCO_AI_PROVIDER_ENUM.OPENROUTER,
47+
].includes(config.OCO_AI_PROVIDER)
48+
) {
49+
return;
50+
}
51+
3952
const completedMigrations = getCompletedMigrations();
4053

4154
let isMigrated = false;

0 commit comments

Comments
 (0)