From 2d969528d944fbcbbcccdc63d5dbd91572e22f63 Mon Sep 17 00:00:00 2001 From: "mark.tkachenko" Date: Wed, 22 Jul 2026 16:38:09 +0200 Subject: [PATCH] fix E2E --- .../e2e/acp-e2e-models-availability.test.ts | 21 +++++++++++++++---- .../e2e/spawned-agent-fixture.ts | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/__tests__/CodexACPAgent/e2e/acp-e2e-models-availability.test.ts b/src/__tests__/CodexACPAgent/e2e/acp-e2e-models-availability.test.ts index e6555e0c..2d9b734a 100644 --- a/src/__tests__/CodexACPAgent/e2e/acp-e2e-models-availability.test.ts +++ b/src/__tests__/CodexACPAgent/e2e/acp-e2e-models-availability.test.ts @@ -2,8 +2,6 @@ import {afterEach, beforeEach, expect, it} from "vitest"; import {createAuthenticatedFixture, describeE2E, type SpawnedAgentFixture,} from "./acp-e2e-test-utils"; import {ModelId} from "../../../ModelId"; -const DEFAULT_MODEL_ID = ModelId.create("gpt-5.4-mini", "medium") - describeE2E("Models availability", () => { let fixture: SpawnedAgentFixture; @@ -17,7 +15,22 @@ describeE2E("Models availability", () => { it(`default model is available`, async () => { const session = await fixture.createSession(); - const models = session.models?.availableModels?.map(m => m.modelId); - expect(models).toContain(DEFAULT_MODEL_ID.toString()) + const models = session.models; + const availableModelIds = models?.availableModels?.map(m => m.modelId) ?? []; + expect(availableModelIds.length).toBeGreaterThan(0); + + // Codex's advertised catalog changes as it is upgraded, so assert the + // invariant that survives those bumps instead of pinning a specific + // model id: the session's current (default) model must be one of the + // advertised models. Compare on the base model id because + // availableModels enumerate model x reasoning-effort pairs while the + // current model may carry an effort (e.g. "none") that is not itself + // enumerated. + const currentModelId = models?.currentModelId; + expect(currentModelId).toBeDefined(); + + const currentBaseModel = ModelId.fromString(currentModelId!).model; + const availableBaseModels = availableModelIds.map(id => ModelId.fromString(id).model); + expect(availableBaseModels).toContain(currentBaseModel); }); }); diff --git a/src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts b/src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts index 32fbbdc3..d4edc609 100644 --- a/src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts +++ b/src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts @@ -10,7 +10,7 @@ import type {PermissionResponder} from "./permission-responders"; import type {LegacyNewSessionResponse} from "../../../AcpExtensions"; export const DEFAULT_TEST_MODEL_ID = ModelId.create("gpt-5.2", "none"); -export const OTHER_TEST_MODEL_ID = ModelId.create("gpt-5.4-mini", "low"); +export const OTHER_TEST_MODEL_ID = ModelId.create("gpt-5.5", "low"); export interface TestSkill { readonly name: string;