Skip to content

Commit 4fc31a7

Browse files
committed
Use explicit model ids in e2e tests
1 parent a2dcf7e commit 4fc31a7

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/__tests__/CodexACPAgent/e2e/acp-e2e-test-utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ export {
99
type PermissionResponder,
1010
} from "./permission-responders";
1111
export {
12+
DEFAULT_TEST_MODEL_ID,
1213
type SpawnedAgentFixture,
1314
type TestSkill,
15+
OTHER_TEST_MODEL_ID,
1416
} from "./spawned-agent-fixture";
1517

1618
export const RUN_E2E_TESTS = process.env["RUN_E2E_TESTS"] === "true";

src/__tests__/CodexACPAgent/e2e/acp-e2e.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import {AgentMode} from "../../../AgentMode";
33
import {
44
createAuthenticatedFixture,
55
createGatewayFixture,
6+
DEFAULT_TEST_MODEL_ID,
67
describeE2E,
8+
OTHER_TEST_MODEL_ID,
79
requireLiveApiKey,
810
type SpawnedAgentFixture,
911
} from "./acp-e2e-test-utils";
@@ -44,20 +46,13 @@ describeE2E("E2E tests", () => {
4446
throw new Error("Agent did not return initial model state.");
4547
}
4648
expect(models.availableModels.length).toBeGreaterThan(0);
47-
48-
const selectedModelId =
49-
models.availableModels.find((model) => model.modelId !== models.currentModelId)?.modelId
50-
?? models.currentModelId
51-
?? models.availableModels[0]?.modelId;
52-
if (!selectedModelId) {
53-
throw new Error("No available models returned by ACP server.");
54-
}
49+
expect(models.currentModelId).toBe(DEFAULT_TEST_MODEL_ID.toString());
5550

5651
await fixture.connection.unstable_setSessionModel({
5752
sessionId: session.sessionId,
58-
modelId: selectedModelId,
53+
modelId: OTHER_TEST_MODEL_ID.toString(),
5954
});
60-
await fixture.expectStatus(session.sessionId, {Model: selectedModelId});
55+
await fixture.expectStatus(session.sessionId, {Model: OTHER_TEST_MODEL_ID});
6156
});
6257

6358
it("changes session mode via setSessionMode and reflects it in /status", async () => {

src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ import os from "node:os";
55
import path from "node:path";
66
import {Readable, Writable} from "node:stream";
77
import {expect, vi} from "vitest";
8+
import {ModelId} from "../../../ModelId";
89
import {removeDirectoryWithRetry, writeCodexHomeConfig} from "../../acp-test-utils";
910
import type {PermissionResponder} from "./permission-responders";
1011

12+
export const DEFAULT_TEST_MODEL_ID = ModelId.create("gpt-5.2", "none");
13+
export const OTHER_TEST_MODEL_ID = ModelId.create("gpt-5.3-codex", "low");
14+
1115
export interface TestSkill {
1216
readonly name: string;
1317
readonly description: string;
@@ -39,8 +43,8 @@ export function createSpawnedAgentFixture(
3943
): SpawnedAgentFixture {
4044
const paths = RuntimePaths.createTemporary();
4145
writeCodexHomeConfig(paths.codexHome, {
42-
model: "gpt-5.2",
43-
model_reasoning_effort: "none",
46+
model: DEFAULT_TEST_MODEL_ID.model,
47+
model_reasoning_effort: DEFAULT_TEST_MODEL_ID.effort,
4448
web_search: "disabled",
4549
});
4650

0 commit comments

Comments
 (0)