fix: preserve supplemental codex effort variants

This commit is contained in:
Tam Nhu Tran
2026-04-22 14:31:40 -04:00
parent e2ca197397
commit 3a63cc0431
2 changed files with 24 additions and 1 deletions
+2 -1
View File
@@ -34,7 +34,8 @@ export function getCodexEffortVariants(
maxEffort: CodexEffort | undefined
): string[] {
if (!maxEffort) {
return [stripCodexEffortSuffix(modelId)];
const explicitEffort = parseCodexEffort(modelId);
return [applyCodexEffortSuffix(modelId, explicitEffort)];
}
const normalizedModelId = stripCodexEffortSuffix(modelId);
@@ -129,4 +129,26 @@ describe('FlexibleModelSelector', () => {
expect(screen.getByText('gpt-5.3-codex')).toBeInTheDocument();
expect(screen.getAllByText('gpt-5.3-codex-high').length).toBeGreaterThan(0);
});
it('preserves explicit suffixes on supplemental codex models outside the static catalog', async () => {
const onChange = vi.fn();
render(
<FlexibleModelSelector
label="Primary model"
value={undefined}
onChange={onChange}
catalog={MODEL_CATALOGS.codex}
allModels={[{ id: 'gpt-5.5-codex-high', owned_by: 'openai' }]}
/>
);
await userEvent.click(screen.getByRole('button', { name: /select model/i }));
expect(screen.getByText(/All Models \(1\)/i)).toBeInTheDocument();
expect(screen.getByText('gpt-5.5-codex-high')).toBeInTheDocument();
await userEvent.click(screen.getByText('gpt-5.5-codex-high'));
expect(onChange).toHaveBeenCalledWith('gpt-5.5-codex-high');
});
});