feat: add gpt-5.5 to codex model catalogs

This commit is contained in:
Tam Nhu Tran committed 2026-04-24 10:30:59 -04:00
1 parent a6170a967d
commit 4efd61ee34
9 files changed
+85 -7

No files matched your search

@@ -45,6 +45,48 @@ async function importCompatibilityModule(cacheTag: string) {
const identity = (message: string) => message;
describe('codex plan compatibility reconcile', () => {
it('warns about the GPT-5.5 free-plan fallback without rewriting saved settings', async () => {
const { tmpDir, settingsPath } = createCodexSettingsFixture();
const errorSpy = spyOn(console, 'error').mockImplementation(() => {});
try {
const { reconcileCodexModelForActivePlan } = await importCompatibilityModule('gpt-5-5-free');
await reconcileCodexModelForActivePlan(
{
currentModel: 'gpt-5.5',
verbose: false,
},
{
getDefaultAccount: () => ({ id: 'free@example.com' }) as never,
fetchCodexQuota: async () => ({
success: true,
windows: [],
coreUsage: { fiveHour: null, weekly: null },
planType: 'free',
lastUpdated: Date.now(),
accountId: 'free@example.com',
}),
formatInfo: identity,
formatWarn: identity,
}
);
const repaired = JSON.parse(fs.readFileSync(settingsPath, 'utf-8')) as {
env: Record<string, string>;
};
expect(repaired.env.ANTHROPIC_MODEL).toBe('gpt-5.3-codex');
expect(repaired.env.ANTHROPIC_DEFAULT_OPUS_MODEL).toBe('gpt-5.3-codex');
expect(repaired.env.ANTHROPIC_DEFAULT_SONNET_MODEL).toBe('gpt-5.3-codex');
expect(repaired.env.ANTHROPIC_DEFAULT_HAIKU_MODEL).toBe('gpt-5.4-mini');
expect(errorSpy).toHaveBeenCalledWith(
'Codex free plan detected. Keeping saved model "gpt-5.5" in settings; runtime requests will fall back to "gpt-5.4" when needed.'
);
} finally {
fs.rmSync(tmpDir, { recursive: true, force: true });
}
});
it('keeps saved Codex settings intact and warns about runtime fallback for free-plan accounts', async () => {
const { tmpDir, settingsPath } = createCodexSettingsFixture('gpt-5.3-codex-spark');
const errorSpy = spyOn(console, 'error').mockImplementation(() => {});
@@ -14,6 +14,8 @@ describe('codex plan compatibility', () => {
});
it('maps paid-only free-plan models to safe fallbacks', () => {
expect(getFreePlanFallbackCodexModel('gpt-5.5')).toBe('gpt-5.4');
expect(getFreePlanFallbackCodexModel('gpt-5.5-xhigh')).toBe('gpt-5.4');
expect(getFreePlanFallbackCodexModel('gpt-5.3-codex')).toBe('gpt-5.4');
expect(getFreePlanFallbackCodexModel('gpt-5.3-codex-xhigh')).toBe('gpt-5.4');
expect(getFreePlanFallbackCodexModel('gpt-5.3-codex(high)')).toBe('gpt-5.4');
@@ -71,6 +73,7 @@ describe('codex plan compatibility', () => {
});
it('tracks Codex thinking caps for current safe defaults, paid models, and legacy aliases', () => {
expect(getModelMaxLevel('codex', 'gpt-5.5')).toBe('xhigh');
expect(getModelMaxLevel('codex', 'gpt-5.4')).toBe('xhigh');
expect(getModelMaxLevel('codex', 'gpt-5.4-mini')).toBe('high');
expect(getModelMaxLevel('codex', 'gpt-5-codex')).toBe('xhigh');
@@ -209,6 +209,7 @@ describe('Model Catalog', () => {
const { MODEL_CATALOG } = modelCatalog;
const ids = MODEL_CATALOG.codex.models.map((m) => m.id);
assert.deepStrictEqual(ids, [
'gpt-5.5',
'gpt-5.4',
'gpt-5.4-mini',
'gpt-5.3-codex',