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,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;

Expand All @@ -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);
});
});
2 changes: 1 addition & 1 deletion src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Comment on lines 12 to +13

export interface TestSkill {
readonly name: string;
Expand Down