test(codex): cover image tool output replay#7704
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new unit test to verify that the Codex passthrough preserves image-view custom tool output input parts. The review feedback suggests casting the returned result of transformRequest and the mock credentials object to prevent TypeScript compilation errors under strict type-checking configurations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const result = executor.transformRequest("gpt-5.6", body, false, { | ||
| requestEndpointPath: "/responses", | ||
| }); | ||
| const toolOutput = result.input.find((item) => item.type === "custom_tool_call_output"); |
There was a problem hiding this comment.
To prevent TypeScript compilation errors under strict type-checking configurations, we should cast the returned result and the mock credentials object. Since transformRequest returns Record<string, unknown>, accessing .input directly and calling .find on it will cause a compilation error because input is not a known property and its type would be unknown. Additionally, the mock credentials object should be cast to any to satisfy the ProviderCredentials parameter type.
| const result = executor.transformRequest("gpt-5.6", body, false, { | |
| requestEndpointPath: "/responses", | |
| }); | |
| const toolOutput = result.input.find((item) => item.type === "custom_tool_call_output"); | |
| const result = executor.transformRequest("gpt-5.6", body, false, { | |
| requestEndpointPath: "/responses", | |
| } as any) as any; | |
| const toolOutput = result.input.find((item: any) => item.type === "custom_tool_call_output"); |
|
Thanks @dongwook-chan! Clean regression guard covering codex image tool-output replay (#7698) — pure test addition, exactly the kind of coverage we want. Validated in local merge-train @ c5997d6b2 (FAST gates green: static + changed tests + vitest). The stale per-PR CI reds were the shared base-red on the release tip, not this PR. |
dd773dc
into
diegosouzapw:release/v3.8.49
Summary
custom_tool_call_output.outputparts asinput_textandinput_imageoutput_textatinput[n].output[m]Root cause
Codex Desktop stores an image-view result as a
custom_tool_call_outputwith anoutputcontent array. OmniRoute previously treated that nested array as assistant output and changedinput_imagetooutput_text. The next Responses request then failed with:PR #7269 already corrected the sanitizer on the current release branch. This PR adds the missing executor-level regression coverage using the exact Codex Desktop payload shape reported in #7698.
Validation
DATA_DIR=<isolated temp dir> DISABLE_SQLITE_AUTO_BACKUP=true node --import tsx/esm --test tests/unit/responses-input-sanitizer-name.test.ts tests/unit/codex-custom-tool-image-output-7698.test.ts— 16 passingnpx eslint tests/unit/codex-custom-tool-image-output-7698.test.tsnpm run check:file-sizegit diff --checkNo production build, database, or running service was replaced or restarted during validation.
Closes #7698