Open History to see the last commit
1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { it } from "@effect/vitest";
3import * as Effect from "effect/Effect";
4import * as Exit from "effect/Exit";
5import * as FileSystem from "effect/FileSystem";
6import * as Layer from "effect/Layer";
7import * as Path from "effect/Path";
8import * as Result from "effect/Result";
9import * as Schema from "effect/Schema";
10import * as Scope from "effect/Scope";
11import { createModelSelection } from "@t3tools/shared/model";
12import { expect } from "vite-plus/test";
13
14import { CodexSettings, ProviderInstanceId, TextGenerationError } from "@t3tools/contracts";
15
16import * as ServerConfig from "../config.ts";
17import * as TextGeneration from "./TextGeneration.ts";
18import { makeCodexTextGeneration } from "./CodexTextGeneration.ts";
19import { writeFakeCli } from "../testUtils/fakeCli.ts";
20const decodeCodexSettings = Schema.decodeSync(CodexSettings);
21
22const DEFAULT_TEST_MODEL_SELECTION = createModelSelection(
23 ProviderInstanceId.make("codex"),
24 "gpt-5.4-mini",
25);
26
27const CodexTextGenerationTestLayer = ServerConfig.ServerConfig.layerTest(process.cwd(), {
28 prefix: "t3code-codex-text-generation-test-",
29}).pipe(Layer.provideMerge(NodeServices.layer));
30
31interface FakeCodexInput {
32 output: string;
33 exitCode?: number;
34 stderr?: string;
35 requireImage?: boolean;
36 requireServiceTier?: string;
37 requireReasoningEffort?: string;
38 forbidReasoningEffort?: boolean;
39 requireArg?: string;
40 forbidArg?: string;
41 stdinMustContain?: string;
42 stdinMustNotContain?: string;
43}
44
45// The stub walks argv the way the shell script it replaced did: `--image`,
46// `--config key=value`, and `--output-last-message <path>` are consumed, the
47// prompt arrives on stdin, and each check exits with its own code so a
48// failing test names the assertion that tripped.
49function makeFakeCodexBinary(dir: string, input: FakeCodexInput) {
50 const check = JSON.stringify({
51 requireImage: input.requireImage ?? false,
52 requireServiceTier: input.requireServiceTier ?? null,
53 requireReasoningEffort: input.requireReasoningEffort ?? null,
54 forbidReasoningEffort: input.forbidReasoningEffort ?? false,
55 requireArg: input.requireArg ?? null,
56 forbidArg: input.forbidArg ?? null,
57 stdinMustContain: input.stdinMustContain ?? null,
58 stdinMustNotContain: input.stdinMustNotContain ?? null,
59 stderr: input.stderr ?? null,
60 output: input.output,
61 exitCode: input.exitCode ?? 0,
62 });
63 return Effect.gen(function* () {
64 const path = yield* Path.Path;
65 return writeFakeCli({
66 directory: path.join(dir, "bin"),
67 name: "codex",
68 source: [
69 'import * as NodeFS from "node:fs";',
70 `const check = ${check};`,
71 "const args = process.argv.slice(2);",
72 'const originalArgs = ` ${args.join(" ")} `;',
73 "let outputPath = null;",
74 "let seenImage = false;",
75 'let seenServiceTier = "";',
76 'let seenReasoningEffort = "";',
77 "for (let index = 0; index < args.length; index += 1) {",
78 ' if (args[index] === "--image") {',
79 " index += 1;",
80 " if (args[index]) seenImage = true;",
81 ' } else if (args[index] === "--config") {',
82 " index += 1;",
83 ' const value = args[index] ?? "";',
84 ' if (value.startsWith("service_tier=")) seenServiceTier = value;',
85 ' if (value.startsWith("model_reasoning_effort=")) seenReasoningEffort = value;',
86 ' } else if (args[index] === "--output-last-message") {',
87 " index += 1;",
88 " outputPath = args[index] ?? null;",
89 " }",
90 "}",
91 "const chunks = [];",
92 "for await (const chunk of process.stdin) chunks.push(chunk);",
93 'const stdinContent = Buffer.concat(chunks).toString("utf8");',
94 "function fail(message, code) {",
95 ' process.stderr.write(message + "\\n");',
96 " process.exit(code);",
97 "}",
98 "if (check.requireArg !== null && !originalArgs.includes(` ${check.requireArg} `)) {",
99 ' fail("missing arg: " + check.requireArg, 8);',
100 "}",
101 "if (check.forbidArg !== null && originalArgs.includes(` ${check.forbidArg} `)) {",
102 ' fail("forbidden arg: " + check.forbidArg, 9);',
103 "}",
104 'if (check.requireImage && !seenImage) fail("missing --image input", 2);',
105 "if (",
106 " check.requireServiceTier !== null &&",
107 ' seenServiceTier !== `service_tier="${check.requireServiceTier}"`',
108 ") {",
109 ' fail("unexpected service tier config: " + seenServiceTier, 5);',
110 "}",
111 "if (",
112 " check.requireReasoningEffort !== null &&",
113 ' seenReasoningEffort !== `model_reasoning_effort="${check.requireReasoningEffort}"`',
114 ") {",
115 ' fail("unexpected reasoning effort config: " + seenReasoningEffort, 6);',
116 "}",
117 "if (check.forbidReasoningEffort && seenReasoningEffort.length > 0) {",
118 ' fail("reasoning effort config should be omitted: " + seenReasoningEffort, 7);',
119 "}",
120 "if (check.stdinMustContain !== null && !stdinContent.includes(check.stdinMustContain)) {",
121 ' fail("stdin missing expected content", 3);',
122 "}",
123 "if (check.stdinMustNotContain !== null && stdinContent.includes(check.stdinMustNotContain)) {",
124 ' fail("stdin contained forbidden content", 4);',
125 "}",
126 'if (check.stderr !== null) process.stderr.write(check.stderr + "\\n");',
127 'if (outputPath !== null) NodeFS.writeFileSync(outputPath, check.output + "\\n");',
128 "process.exitCode = check.exitCode;",
129 "",
130 ].join("\n"),
131 });
132 });
133}
134
135function withFakeCodexEnv<A, E, R>(
136 input: FakeCodexInput & {
137 launchArgs?: string;
138 environment?: NodeJS.ProcessEnv;
139 models?: ReadonlyArray<string>;
140 },
141 effectFn: (textGeneration: TextGeneration.TextGeneration["Service"]) => Effect.Effect<A, E, R>,
142) {
143 return Effect.gen(function* () {
144 const fs = yield* FileSystem.FileSystem;
145 const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3code-codex-text-" });
146 const codexPath = yield* makeFakeCodexBinary(tempDir, input);
147 const config = decodeCodexSettings({ binaryPath: codexPath, launchArgs: input.launchArgs });
148 const textGeneration = yield* makeCodexTextGeneration(
149 config,
150 input.environment === undefined ? undefined : { ...process.env, ...input.environment },
151 Effect.succeed(
152 (input.models ?? []).map((slug) => ({
153 slug,
154 name: slug,
155 isCustom: false,
156 capabilities: null,
157 })),
158 ),
159 );
160 return yield* effectFn(textGeneration);
161 }).pipe(Effect.scoped);
162}
163
164it.layer(CodexTextGenerationTestLayer)("CodexTextGeneration", (it) => {
165 for (const selectedModel of ["gpt-5.6-luna", "openai.gpt-5.6-luna"]) {
166 it.effect(`dispatches the qualified live model for ${selectedModel}`, () =>
167 withFakeCodexEnv(
168 {
169 output: JSON.stringify({ title: "Bedrock title" }),
170 models: ["openai.gpt-5.6-luna"],
171 requireArg: "--model openai.gpt-5.6-luna",
172 forbidArg: "--model gpt-5.6-luna",
173 },
174 (textGeneration) =>
175 Effect.gen(function* () {
176 const result = yield* textGeneration.generateThreadTitle({
177 cwd: process.cwd(),
178 message: "Describe this change",
179 modelSelection: createModelSelection(ProviderInstanceId.make("codex"), selectedModel),
180 });
181 expect(result.title).toBe("Bedrock title");
182 }),
183 ),
184 );
185 }
186 it.effect("generates and sanitizes commit messages without branch by default", () =>
187 withFakeCodexEnv(
188 {
189 output: JSON.stringify({
190 subject:
191 " Add important change to the system with too much detail and a trailing period.\nsecondary line",
192 body: "\n- added migration\n- updated tests\n",
193 }),
194 stdinMustNotContain: "branch must be a short semantic git branch fragment",
195 },
196 (textGeneration) =>
197 Effect.gen(function* () {
198 const generated = yield* textGeneration.generateCommitMessage({
199 cwd: process.cwd(),
200 branch: "feature/codex-effect",
201 stagedSummary: "M README.md",
202 stagedPatch: "diff --git a/README.md b/README.md",
203 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
204 });
205
206 expect(generated.subject.length).toBeLessThanOrEqual(72);
207 expect(generated.subject.endsWith(".")).toBe(false);
208 expect(generated.body).toBe("- added migration\n- updated tests");
209 expect(generated.branch).toBeUndefined();
210 }),
211 ),
212 );
213
214 it.effect(
215 "forwards codex service tier and non-default reasoning effort into codex exec config",
216 () =>
217 withFakeCodexEnv(
218 {
219 output: JSON.stringify({
220 subject: "Add important change",
221 body: "",
222 }),
223 requireServiceTier: "priority",
224 requireReasoningEffort: "xhigh",
225 stdinMustNotContain: "branch must be a short semantic git branch fragment",
226 },
227 (textGeneration) =>
228 textGeneration.generateCommitMessage({
229 cwd: process.cwd(),
230 branch: "feature/codex-effect",
231 stagedSummary: "M README.md",
232 stagedPatch: "diff --git a/README.md b/README.md",
233 modelSelection: createModelSelection(ProviderInstanceId.make("codex"), "gpt-5.4", [
234 { id: "reasoningEffort", value: "xhigh" },
235 { id: "serviceTier", value: "priority" },
236 ]),
237 }),
238 ),
239 );
240
241 it.effect("passes exec-safe launch args into codex exec", () =>
242 withFakeCodexEnv(
243 {
244 output: JSON.stringify({
245 subject: "Add important change",
246 body: "",
247 }),
248 launchArgs: "--strict-config --listen off",
249 requireArg: "--strict-config",
250 forbidArg: "--listen",
251 },
252 (textGeneration) =>
253 textGeneration.generateCommitMessage({
254 cwd: process.cwd(),
255 branch: "feature/codex-effect",
256 stagedSummary: "M README.md",
257 stagedPatch: "diff --git a/README.md b/README.md",
258 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
259 }),
260 ),
261 );
262
263 it.effect("uses T3CODE_CODEX_LAUNCH_ARGS for codex exec over settings", () =>
264 withFakeCodexEnv(
265 {
266 output: JSON.stringify({
267 subject: "Add important change",
268 body: "",
269 }),
270 launchArgs: "--enable settings-feature",
271 environment: { ...process.env, T3CODE_CODEX_LAUNCH_ARGS: " --strict-config --listen off " },
272 requireArg: "--strict-config",
273 forbidArg: "settings-feature",
274 },
275 (textGeneration) =>
276 textGeneration.generateCommitMessage({
277 cwd: process.cwd(),
278 branch: "feature/codex-effect",
279 stagedSummary: "M README.md",
280 stagedPatch: "diff --git a/README.md b/README.md",
281 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
282 }),
283 ),
284 );
285
286 it.effect("defaults git text generation codex effort to low", () =>
287 withFakeCodexEnv(
288 {
289 output: JSON.stringify({
290 subject: "Add important change",
291 body: "",
292 }),
293 requireReasoningEffort: "low",
294 },
295 (textGeneration) =>
296 textGeneration.generateCommitMessage({
297 cwd: process.cwd(),
298 branch: "feature/codex-effect",
299 stagedSummary: "M README.md",
300 stagedPatch: "diff --git a/README.md b/README.md",
301 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
302 }),
303 ),
304 );
305
306 it.effect("generates commit message with branch when includeBranch is true", () =>
307 withFakeCodexEnv(
308 {
309 output: JSON.stringify({
310 subject: "Add important change",
311 body: "",
312 branch: "fix/important-system-change",
313 }),
314 stdinMustContain: "branch must be a short semantic git branch fragment",
315 },
316 (textGeneration) =>
317 Effect.gen(function* () {
318 const generated = yield* textGeneration.generateCommitMessage({
319 cwd: process.cwd(),
320 branch: "feature/codex-effect",
321 stagedSummary: "M README.md",
322 stagedPatch: "diff --git a/README.md b/README.md",
323 includeBranch: true,
324 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
325 });
326
327 expect(generated.subject).toBe("Add important change");
328 expect(generated.branch).toBe("feature/fix/important-system-change");
329 }),
330 ),
331 );
332
333 it.effect("generates PR content and trims markdown body", () =>
334 withFakeCodexEnv(
335 {
336 output: JSON.stringify({
337 title: " Improve orchestration flow\nwith ignored suffix",
338 body: "\n## Summary\n- improve flow\n\n## Testing\n- bun test\n\n",
339 }),
340 },
341 (textGeneration) =>
342 Effect.gen(function* () {
343 const generated = yield* textGeneration.generatePrContent({
344 cwd: process.cwd(),
345 baseBranch: "main",
346 headBranch: "feature/codex-effect",
347 commitSummary: "feat: improve orchestration flow",
348 diffSummary: "2 files changed",
349 diffPatch: "diff --git a/a.ts b/a.ts",
350 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
351 });
352
353 expect(generated.title).toBe("Improve orchestration flow");
354 expect(generated.body.startsWith("## Summary")).toBe(true);
355 expect(generated.body.endsWith("\n\n")).toBe(false);
356 }),
357 ),
358 );
359
360 it.effect("generates branch names and normalizes branch fragments", () =>
361 withFakeCodexEnv(
362 {
363 output: JSON.stringify({
364 branch: " Feat/Session ",
365 }),
366 stdinMustNotContain: "Image attachments supplied to the model",
367 },
368 (textGeneration) =>
369 Effect.gen(function* () {
370 const generated = yield* textGeneration.generateBranchName({
371 cwd: process.cwd(),
372 message: "Please update session handling.",
373 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
374 });
375
376 expect(generated.branch).toBe("feat/session");
377 }),
378 ),
379 );
380
381 it.effect("generates branch names even when the ambient scope is already closed", () =>
382 withFakeCodexEnv(
383 {
384 output: JSON.stringify({
385 branch: "feat/background-generation",
386 }),
387 },
388 (textGeneration) =>
389 Effect.gen(function* () {
390 // Background fibers (e.g. the worktree branch rename fork) can run
391 // after their launching request's scope has closed; temp files must
392 // not be tied to that ambient scope or they are reaped on creation.
393 const closedScope = yield* Scope.make();
394 yield* Scope.close(closedScope, Exit.void);
395
396 const generated = yield* textGeneration
397 .generateBranchName({
398 cwd: process.cwd(),
399 message: "Please update session handling.",
400 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
401 })
402 .pipe(Effect.provideService(Scope.Scope, closedScope));
403
404 expect(generated.branch).toBe("feat/background-generation");
405 }),
406 ),
407 );
408
409 it.effect("generates thread titles and trims them for sidebar use", () =>
410 withFakeCodexEnv(
411 {
412 output: JSON.stringify({
413 title:
414 ' "Investigate websocket reconnect regressions after worktree restore" \nignored line',
415 }),
416 },
417 (textGeneration) =>
418 Effect.gen(function* () {
419 const generated = yield* textGeneration.generateThreadTitle({
420 cwd: process.cwd(),
421 message: "Please investigate websocket reconnect regressions after a worktree restore.",
422 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
423 });
424
425 expect(generated.title).toBe(
426 "Investigate websocket reconnect regressions after worktree restore",
427 );
428 }),
429 ),
430 );
431
432 it.effect("returns the refinement signal for an unresolved subject", () =>
433 withFakeCodexEnv(
434 { output: JSON.stringify({ title: "Investigate issue", needsRefinement: true }) },
435 (textGeneration) =>
436 Effect.gen(function* () {
437 expect(
438 yield* textGeneration.generateThreadTitle({
439 cwd: process.cwd(),
440 message: "Fix this",
441 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
442 }),
443 ).toEqual({ title: "Investigate issue", needsRefinement: true });
444 }),
445 ),
446 );
447
448 it.effect("falls back when thread title normalization becomes whitespace-only", () =>
449 withFakeCodexEnv(
450 {
451 output: JSON.stringify({
452 title: ' """ """ ',
453 }),
454 },
455 (textGeneration) =>
456 Effect.gen(function* () {
457 const generated = yield* textGeneration.generateThreadTitle({
458 cwd: process.cwd(),
459 message: "Name this thread.",
460 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
461 });
462
463 expect(generated.title).toBe("New thread");
464 }),
465 ),
466 );
467
468 it.effect("trims whitespace exposed after quote removal in thread titles", () =>
469 withFakeCodexEnv(
470 {
471 output: JSON.stringify({
472 title: ` "' hello world '" `,
473 }),
474 },
475 (textGeneration) =>
476 Effect.gen(function* () {
477 const generated = yield* textGeneration.generateThreadTitle({
478 cwd: process.cwd(),
479 message: "Name this thread.",
480 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
481 });
482
483 expect(generated.title).toBe("hello world");
484 }),
485 ),
486 );
487
488 it.effect("omits attachment metadata section when no attachments are provided", () =>
489 withFakeCodexEnv(
490 {
491 output: JSON.stringify({
492 branch: "fix/session-timeout",
493 }),
494 stdinMustNotContain: "Attachment metadata:",
495 },
496 (textGeneration) =>
497 Effect.gen(function* () {
498 const generated = yield* textGeneration.generateBranchName({
499 cwd: process.cwd(),
500 message: "Fix timeout behavior.",
501 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
502 });
503
504 expect(generated.branch).toBe("fix/session-timeout");
505 }),
506 ),
507 );
508
509 it.effect("passes image attachments through as codex image inputs", () =>
510 withFakeCodexEnv(
511 {
512 output: JSON.stringify({
513 branch: "fix/ui-regression",
514 }),
515 requireImage: true,
516 stdinMustContain: "Attachment metadata:",
517 },
518 (textGeneration) =>
519 Effect.gen(function* () {
520 const fs = yield* FileSystem.FileSystem;
521 const path = yield* Path.Path;
522 const { attachmentsDir } = yield* ServerConfig.ServerConfig;
523 const attachmentId = "thread-branch-image-attachment";
524 const attachmentPath = path.join(attachmentsDir, `${attachmentId}.png`);
525 yield* fs.makeDirectory(attachmentsDir, { recursive: true });
526 yield* fs.writeFile(attachmentPath, Buffer.from("hello"));
527
528 const generated = yield* textGeneration.generateBranchName({
529 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
530 cwd: process.cwd(),
531 message: "Fix layout bug from screenshot.",
532 attachments: [
533 {
534 type: "image",
535 id: attachmentId,
536 name: "bug.png",
537 mimeType: "image/png",
538 sizeBytes: 5,
539 },
540 ],
541 });
542
543 expect(generated.branch).toBe("fix/ui-regression");
544 }),
545 ),
546 );
547
548 it.effect("resolves persisted attachment ids to files for codex image inputs", () =>
549 withFakeCodexEnv(
550 {
551 output: JSON.stringify({
552 branch: "fix/ui-regression",
553 }),
554 requireImage: true,
555 },
556 (textGeneration) =>
557 Effect.gen(function* () {
558 const fs = yield* FileSystem.FileSystem;
559 const path = yield* Path.Path;
560 const { attachmentsDir } = yield* ServerConfig.ServerConfig;
561 const attachmentId = "thread-1-attachment";
562 const imagePath = path.join(attachmentsDir, `${attachmentId}.png`);
563 yield* fs.makeDirectory(attachmentsDir, { recursive: true });
564 yield* fs.writeFile(imagePath, Buffer.from("hello"));
565
566 const generated = yield* textGeneration
567 .generateBranchName({
568 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
569 cwd: process.cwd(),
570 message: "Fix layout bug from screenshot.",
571 attachments: [
572 {
573 type: "image",
574 id: attachmentId,
575 name: "bug.png",
576 mimeType: "image/png",
577 sizeBytes: 5,
578 },
579 ],
580 })
581 .pipe(
582 Effect.tap(() =>
583 fs.stat(imagePath).pipe(
584 Effect.map((fileInfo) => {
585 expect(fileInfo.type).toBe("File");
586 }),
587 ),
588 ),
589 Effect.ensuring(fs.remove(imagePath).pipe(Effect.catch(() => Effect.void))),
590 );
591
592 expect(generated.branch).toBe("fix/ui-regression");
593 }),
594 ),
595 );
596
597 it.effect("ignores missing attachment ids for codex image inputs", () =>
598 withFakeCodexEnv(
599 {
600 output: JSON.stringify({
601 branch: "fix/ui-regression",
602 }),
603 requireImage: true,
604 },
605 (textGeneration) =>
606 Effect.gen(function* () {
607 const fs = yield* FileSystem.FileSystem;
608 const path = yield* Path.Path;
609 const { attachmentsDir } = yield* ServerConfig.ServerConfig;
610 const missingAttachmentId = "thread-missing-attachment";
611 const missingPath = path.join(attachmentsDir, `${missingAttachmentId}.png`);
612 yield* fs.remove(missingPath).pipe(Effect.catch(() => Effect.void));
613
614 const result = yield* textGeneration
615 .generateBranchName({
616 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
617 cwd: process.cwd(),
618 message: "Fix layout bug from screenshot.",
619 attachments: [
620 {
621 type: "image",
622 id: missingAttachmentId,
623 name: "outside.png",
624 mimeType: "image/png",
625 sizeBytes: 5,
626 },
627 ],
628 })
629 .pipe(Effect.result);
630
631 expect(Result.isFailure(result)).toBe(true);
632 if (Result.isFailure(result)) {
633 expect(result.failure).toBeInstanceOf(TextGenerationError);
634 expect(result.failure.message).toContain("missing --image input");
635 }
636 }),
637 ),
638 );
639
640 it.effect(
641 "fails with typed TextGenerationError when codex returns wrong branch payload shape",
642 () =>
643 withFakeCodexEnv(
644 {
645 output: JSON.stringify({
646 title: "This is not a branch payload",
647 }),
648 },
649 (textGeneration) =>
650 Effect.gen(function* () {
651 const result = yield* textGeneration
652 .generateBranchName({
653 cwd: process.cwd(),
654 message: "Fix websocket reconnect flake",
655 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
656 })
657 .pipe(Effect.result);
658
659 expect(Result.isFailure(result)).toBe(true);
660 if (Result.isFailure(result)) {
661 expect(result.failure).toBeInstanceOf(TextGenerationError);
662 expect(result.failure.message).toContain("Codex returned invalid structured output");
663 }
664 }),
665 ),
666 );
667
668 it.effect("returns typed TextGenerationError when codex exits non-zero", () =>
669 withFakeCodexEnv(
670 {
671 output: JSON.stringify({ subject: "ignored", body: "" }),
672 exitCode: 1,
673 stderr: "codex execution failed",
674 },
675 (textGeneration) =>
676 Effect.gen(function* () {
677 const result = yield* textGeneration
678 .generateCommitMessage({
679 cwd: process.cwd(),
680 branch: "feature/codex-error",
681 stagedSummary: "M README.md",
682 stagedPatch: "diff --git a/README.md b/README.md",
683 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
684 })
685 .pipe(Effect.result);
686
687 expect(Result.isFailure(result)).toBe(true);
688 if (Result.isFailure(result)) {
689 expect(result.failure).toBeInstanceOf(TextGenerationError);
690 expect(result.failure.message).toContain(
691 "Codex CLI command failed: codex execution failed",
692 );
693 }
694 }),
695 ),
696 );
697});