Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, onMounted, ref } from 'vue';
import {
CODEX_MODEL_OPTIONS,
DEFAULT_CODEX_MODEL,
DEFAULT_SETTINGS,
deleteProviderConfig,
disconnectCodex,
Expand Down Expand Up @@ -30,7 +31,7 @@ const loading = ref(false);
const saving = ref(false);
const redirectUrl = ref('');
const showRedirectPanel = ref(false);
const codexModel = ref(CODEX_MODEL_OPTIONS[0]);
const codexModel = ref<string>(DEFAULT_CODEX_MODEL);
const openaiForm = ref({ apiKey: '', baseUrl: DEFAULT_SETTINGS.openai.baseUrl, model: DEFAULT_SETTINGS.openai.model });
const geminiForm = ref({ apiKey: '', baseUrl: DEFAULT_SETTINGS.gemini.baseUrl, model: DEFAULT_SETTINGS.gemini.model });

Expand Down Expand Up @@ -69,7 +70,7 @@ async function loadPage(): Promise<void> {
]);
settings.value = nextSettings;
codexStatus.value = nextCodex;
codexModel.value = nextCodex.model || CODEX_MODEL_OPTIONS[0];
codexModel.value = nextCodex.model || DEFAULT_CODEX_MODEL;
openaiForm.value = { apiKey: '', baseUrl: nextSettings.openai.baseUrl, model: nextSettings.openai.model };
geminiForm.value = { apiKey: '', baseUrl: nextSettings.gemini.baseUrl, model: nextSettings.gemini.model };
status.value = 'AI provider settings loaded';
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/modules/admin-ai-provider-settings/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export const CODEX_MODEL_OPTIONS = [
'gpt-5.4-mini',
'gpt-5.3-codex',
'gpt-5.2'
];
] as const satisfies readonly [string, ...string[]];

export const DEFAULT_CODEX_MODEL = CODEX_MODEL_OPTIONS[0];

export async function fetchAiProviderSettings(): Promise<AiProviderSettings> {
return normalizeSettings(await requestAdmin<unknown>('/api/ai-provider-settings'));
Expand Down Expand Up @@ -151,7 +153,7 @@ function normalizeCodexStatus(payload: unknown): CodexConnectionStatus {
connected: record.connected === true,
keyType: record.keyType === 'oauth' ? 'oauth' : null,
updatedAt: readString(record.updatedAt) || null,
model: readString(record.model) || CODEX_MODEL_OPTIONS[0],
model: readString(record.model) || DEFAULT_CODEX_MODEL,
purposes: Array.isArray(record.purposes) ? record.purposes.filter((item): item is string => typeof item === 'string') : [],
clientIdConfigured: record.clientIdConfigured !== false
};
Expand Down
Loading