feat: support minimal codex effort aliases

This commit is contained in:
Tam Nhu Tran committed 2026-05-20 11:11:46 -04:00
1 parent f0ad68d446
commit 6569eed15b
18 files changed
+204 -29

No files matched your search

@@ -228,9 +228,10 @@ export function ModelConfigSection({
) : null}
{provider === 'codex' && (
<p className="text-[11px] text-muted-foreground mb-3 rounded-md border bg-muted/30 px-2.5 py-2">
Codex tip: suffixes <code>-medium</code>, <code>-high</code>, and <code>-xhigh</code>{' '}
pin reasoning effort. <code>-fast</code> enables the Codex fast service tier on models
that support it, including combined forms such as <code>gpt-5.4-high-fast</code>.
Codex tip: suffixes <code>-minimal</code>, <code>-low</code>, <code>-medium</code>,{' '}
<code>-high</code>, and <code>-xhigh</code> pin reasoning effort. <code>-fast</code>{' '}
enables the Codex fast service tier on models that support it, including combined forms
such as <code>gpt-5.4-high-fast</code>.
</p>
)}
<div className="space-y-4">
@@ -16,6 +16,7 @@ import type { CodexEffort, CodexServiceTier } from '@/lib/codex-effort';
import {
getCodexEffortDisplay,
getCodexEffortVariants,
parseCodexEffort,
parseCodexServiceTier,
} from '@/lib/codex-effort';
import { getResolvedCatalogModels, getSupplementalCatalogModels } from '@/lib/model-catalogs';
@@ -344,6 +345,13 @@ function getModelOptionValues(
: [optionValue];
}
function getRecommendedGroupKey(optionValue: string, isCodexProvider: boolean): string {
if (!isCodexProvider) return 'recommended';
if (parseCodexServiceTier(optionValue)) return 'codex-fast';
if (parseCodexEffort(optionValue)) return 'codex-reasoning';
return 'recommended';
}
export function FlexibleModelSelector({
label,
description,
@@ -400,7 +408,7 @@ export function FlexibleModelSelector({
return optionValues.map((optionValue) => ({
value: optionValue,
groupKey: 'recommended',
groupKey: getRecommendedGroupKey(optionValue, isCodexProvider),
searchText: `${optionValue} ${model.id} ${model.name} ${routingHint?.recommendedModelId ?? ''}`,
keywords: [model.tier ?? '', catalog?.provider ?? ''],
triggerContent: (
@@ -555,6 +563,26 @@ export function FlexibleModelSelector({
<span className="text-xs text-primary">{t('providerModelSelector.recommended')}</span>
),
},
...(isCodexProvider
? [
{
key: 'codex-reasoning',
label: (
<span className="text-xs text-muted-foreground">
{t('providerModelSelector.codexReasoningVariants')}
</span>
),
},
{
key: 'codex-fast',
label: (
<span className="text-xs text-amber-600">
{t('providerModelSelector.codexFastVariants')}
</span>
),
},
]
: []),
...(allModelOptions.length > 0
? [
{