| 1 | import type { createClient } from '@libsql/client' |
| 2 | |
| 3 | type LibSqlClient = ReturnType<typeof createClient> |
| 4 | |
| 5 | /** |
| 6 | * Patch: add thinking_parameter_mode column to model_configs table. |
| 7 | * Default auto preserves existing centralized OpenAI-compatible behavior. |
| 8 | */ |
| 9 | export const patchModelConfigThinkingParameterMode = async ( |
| 10 | client: LibSqlClient |
| 11 | ): Promise<void> => { |
| 12 | const cols = await client.execute("PRAGMA table_info('model_configs')") |
| 13 | const hasColumn = cols.rows.some((r) => r.name === 'thinking_parameter_mode') |
| 14 | if (hasColumn) return |
| 15 | |
| 16 | await client.execute( |
| 17 | "ALTER TABLE model_configs ADD COLUMN thinking_parameter_mode TEXT NOT NULL DEFAULT 'auto'" |
| 18 | ) |
| 19 | } |
| 20 |