Skip to content

Commit 820a5f2

Browse files
committed
🤖 fix: switch runtimeFileEditing tests to codex-mini for faster response
The file editing integration tests were flaky due to timeout waiting for Anthropic Claude Haiku API responses (15s timeout). Switching to OpenAI's gpt-5.1-codex-mini model which is faster and more reliable for these simple file editing tasks. Also fixed the helper constant name from GPT_5_MINI_MODEL to CODEX_MINI_MODEL with the correct model identifier (gpt-5.1-codex-mini). _Generated with mux_
1 parent 284dbc7 commit 820a5f2

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

tests/ipcMain/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { ToolPolicy } from "../../src/common/utils/tools/toolPolicy";
2222
export const INIT_HOOK_WAIT_MS = 1500; // Wait for async init hook completion (local runtime)
2323
export const SSH_INIT_WAIT_MS = 7000; // SSH init includes sync + checkout + hook, takes longer
2424
export const HAIKU_MODEL = "anthropic:claude-haiku-4-5"; // Fast model for tests
25-
export const GPT_5_MINI_MODEL = "openai:gpt-5-mini"; // Fastest model for performance-critical tests
25+
export const CODEX_MINI_MODEL = "openai:gpt-5.1-codex-mini"; // Fastest model for performance-critical tests
2626
export const TEST_TIMEOUT_LOCAL_MS = 25000; // Recommended timeout for local runtime tests
2727
export const TEST_TIMEOUT_SSH_MS = 60000; // Recommended timeout for SSH runtime tests
2828
export const STREAM_TIMEOUT_LOCAL_MS = 15000; // Stream timeout for local runtime

tests/ipcMain/runtimeFileEditing.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
sendMessageAndWait,
2828
extractTextFromEvents,
2929
writeFileViaBash,
30-
HAIKU_MODEL,
30+
CODEX_MINI_MODEL,
3131
TEST_TIMEOUT_LOCAL_MS,
3232
TEST_TIMEOUT_SSH_MS,
3333
STREAM_TIMEOUT_LOCAL_MS,
@@ -53,7 +53,7 @@ const describeIntegration = shouldRunIntegrationTests() ? describe : describe.sk
5353

5454
// Validate API keys before running tests
5555
if (shouldRunIntegrationTests()) {
56-
validateApiKeys(["ANTHROPIC_API_KEY"]);
56+
validateApiKeys(["OPENAI_API_KEY"]);
5757
}
5858

5959
// SSH server config (shared across all SSH tests)
@@ -112,8 +112,8 @@ describeIntegration("Runtime File Editing Tools", () => {
112112
try {
113113
// Setup provider
114114
await setupProviders(env.mockIpcRenderer, {
115-
anthropic: {
116-
apiKey: getApiKey("ANTHROPIC_API_KEY"),
115+
openai: {
116+
apiKey: getApiKey("OPENAI_API_KEY"),
117117
},
118118
});
119119

@@ -142,7 +142,7 @@ describeIntegration("Runtime File Editing Tools", () => {
142142
env,
143143
workspaceId,
144144
`Use the file_read tool to read ${testFileName} and tell me what it contains.`,
145-
HAIKU_MODEL,
145+
CODEX_MINI_MODEL,
146146
FILE_TOOLS_ONLY,
147147
streamTimeout
148148
);
@@ -182,8 +182,8 @@ describeIntegration("Runtime File Editing Tools", () => {
182182
try {
183183
// Setup provider
184184
await setupProviders(env.mockIpcRenderer, {
185-
anthropic: {
186-
apiKey: getApiKey("ANTHROPIC_API_KEY"),
185+
openai: {
186+
apiKey: getApiKey("OPENAI_API_KEY"),
187187
},
188188
});
189189

@@ -212,7 +212,7 @@ describeIntegration("Runtime File Editing Tools", () => {
212212
env,
213213
workspaceId,
214214
`Use the file_edit_replace_string tool to replace "brown fox" with "red panda" in ${testFileName}.`,
215-
HAIKU_MODEL,
215+
CODEX_MINI_MODEL,
216216
FILE_TOOLS_ONLY,
217217
streamTimeout
218218
);
@@ -258,8 +258,8 @@ describeIntegration("Runtime File Editing Tools", () => {
258258
try {
259259
// Setup provider
260260
await setupProviders(env.mockIpcRenderer, {
261-
anthropic: {
262-
apiKey: getApiKey("ANTHROPIC_API_KEY"),
261+
openai: {
262+
apiKey: getApiKey("OPENAI_API_KEY"),
263263
},
264264
});
265265

@@ -288,7 +288,7 @@ describeIntegration("Runtime File Editing Tools", () => {
288288
env,
289289
workspaceId,
290290
`Use the file_edit_insert (preferred) or file_edit_replace_string tool to insert "Line 2" between Line 1 and Line 3 in ${testFileName}.`,
291-
HAIKU_MODEL,
291+
CODEX_MINI_MODEL,
292292
FILE_TOOLS_ONLY,
293293
streamTimeout
294294
);
@@ -335,8 +335,8 @@ describeIntegration("Runtime File Editing Tools", () => {
335335
try {
336336
// Setup provider
337337
await setupProviders(env.mockIpcRenderer, {
338-
anthropic: {
339-
apiKey: getApiKey("ANTHROPIC_API_KEY"),
338+
openai: {
339+
apiKey: getApiKey("OPENAI_API_KEY"),
340340
},
341341
});
342342

@@ -365,7 +365,7 @@ describeIntegration("Runtime File Editing Tools", () => {
365365
env,
366366
workspaceId,
367367
`Replace the text in ${relativeTestFile}: change "Original" to "Modified"`,
368-
HAIKU_MODEL,
368+
CODEX_MINI_MODEL,
369369
FILE_TOOLS_ONLY,
370370
streamTimeout
371371
);

0 commit comments

Comments
 (0)