Skip to content

test(codex): cover image tool output replay#7704

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.49from
dongwook-chan:fix/codex-image-tool-replay-7698
Jul 19, 2026
Merged

test(codex): cover image tool output replay#7704
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.49from
dongwook-chan:fix/codex-image-tool-replay-7698

Conversation

@dongwook-chan

Copy link
Copy Markdown
Contributor

Summary

  • add an executor-level regression test for Codex Desktop image-view history replay
  • verify native Codex passthrough keeps custom_tool_call_output.output parts as input_text and input_image
  • guard against reintroducing the upstream-rejected output_text at input[n].output[m]

Root cause

Codex Desktop stores an image-view result as a custom_tool_call_output with an output content array. OmniRoute previously treated that nested array as assistant output and changed input_image to output_text. The next Responses request then failed with:

Invalid value: 'output_text'. Supported values are: 'input_text',
'input_image', 'input_file', and 'scoped_content'.

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 passing
  • npx eslint tests/unit/codex-custom-tool-image-output-7698.test.ts
  • npm run check:file-size
  • git diff --check

No production build, database, or running service was replaced or restarted during validation.

Closes #7698

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +28 to +31
const result = executor.transformRequest("gpt-5.6", body, false, {
requestEndpointPath: "/responses",
});
const toolOutput = result.input.find((item) => item.type === "custom_tool_call_output");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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");

@diegosouzapw

Copy link
Copy Markdown
Owner

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.

@diegosouzapw
diegosouzapw merged commit dd773dc into diegosouzapw:release/v3.8.49 Jul 19, 2026
8 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(providers): Codex desktop image input returns 400 Invalid value: 'output_text'

2 participants