Repository navigation
fix(codex): preserve native Responses passthrough tools and history - #3107
diegosouzapw merged 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds "tool_search" to the set of hosted tool types (CODEX_HOSTED_TOOL_TYPES) in open-sse/executors/codex.ts and updates the corresponding unit tests in tests/unit/executor-codex.test.ts to verify that the tool is preserved during request transformation. There are no review comments, and I have no feedback to provide.
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.
| // `{ type: "namespace", name: "mcp__atlassian__", tools: [...] }` for MCP tool groups. | ||
| // Keep them through `normalizeCodexTools` so upstream can execute them. | ||
| const CODEX_HOSTED_TOOL_TYPES: ReadonlySet<string> = new Set([ | ||
| "tool_search", |
There was a problem hiding this comment.
SUGGESTION: Adding "tool_search" to the CODEX_HOSTED_TOOL_TYPES set is appropriate. This hosted tool type should be preserved through normalizeCodexTools like other hosted tools.
| ], | ||
| }, | ||
| { type: "image_generation", output_format: "png" }, | ||
| { type: "tool_search" }, |
There was a problem hiding this comment.
SUGGESTION: Adding the tool_search tool type to the test input is correct. This verifies the new hosted tool type is handled properly.
| assert.deepEqual(types, [ | ||
| "function", | ||
| "namespace", | ||
| "image_generation", |
There was a problem hiding this comment.
SUGGESTION: Adding "tool_search" to the expected output types array is correct. This completes the test verification for the new hosted tool type.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Notes on Incremental ChangesThis PR was previously reviewed at commit
All changes are well-tested and follow the existing codebase patterns. The previous review suggestions regarding Reviewed by laguna-m.1-20260312:free · 921,973 tokens |
|
Thanks for the careful work, @yinaoxiong! 🙌 Preserving native Codex Responses passthrough tools ( |
…iegosouzapw#3107) * fix(codex): preserve tool_search hosted tool * fix(codex): preserve native custom tools * fix(codex): preserve native assistant commentary history
…ors hall Adds entries for diegosouzapw#3097, diegosouzapw#3101 (deepseek-web diegosouzapw#2942/diegosouzapw#2820), diegosouzapw#3104, diegosouzapw#3105, diegosouzapw#3107, diegosouzapw#3109, diegosouzapw#3111, diegosouzapw#3113, diegosouzapw#3115, diegosouzapw#3122, diegosouzapw#3125, diegosouzapw#3127, diegosouzapw#3129, plus a Contributors section crediting all v3.8.9 contributors. Stamps the 3.8.9 release date.
…iegosouzapw#3107) * fix(codex): preserve tool_search hosted tool * fix(codex): preserve native custom tools * fix(codex): preserve native assistant commentary history
…ors hall Adds entries for diegosouzapw#3097, diegosouzapw#3101 (deepseek-web diegosouzapw#2942/diegosouzapw#2820), diegosouzapw#3104, diegosouzapw#3105, diegosouzapw#3107, diegosouzapw#3109, diegosouzapw#3111, diegosouzapw#3113, diegosouzapw#3115, diegosouzapw#3122, diegosouzapw#3125, diegosouzapw#3127, diegosouzapw#3129, plus a Contributors section crediting all v3.8.9 contributors. Stamps the 3.8.9 release date.
…iegosouzapw#3107) * fix(codex): preserve tool_search hosted tool * fix(codex): preserve native custom tools * fix(codex): preserve native assistant commentary history
…ors hall Adds entries for diegosouzapw#3097, diegosouzapw#3101 (deepseek-web diegosouzapw#2942/diegosouzapw#2820), diegosouzapw#3104, diegosouzapw#3105, diegosouzapw#3107, diegosouzapw#3109, diegosouzapw#3111, diegosouzapw#3113, diegosouzapw#3115, diegosouzapw#3122, diegosouzapw#3125, diegosouzapw#3127, diegosouzapw#3129, plus a Contributors section crediting all v3.8.9 contributors. Stamps the 3.8.9 release date.
Summary
This PR fixes several Codex native Responses passthrough regressions where OmniRoute was dropping protocol-native tools or history items before forwarding requests to the Codex backend.
Changes:
tool_searchhosted tool innormalizeCodexTools().customtools such asapply_patch, including their freeform grammarformat.strictvalues when normalizing Codex tools.phase: "commentary"andoutput_textcontent in Codex native passthrough mode.Background
Recent Codex CLI versions send richer native Responses API payloads through
/v1/responses. These payloads include protocol-native items that are not plain OpenAI-compatible function tools:{ "type": "tool_search" }tool.apply_patchis sent as a Responses API custom/freeform tool:{ "type": "custom", "name": "apply_patch", "format": ... }.{ "role": "assistant", "phase": "commentary", "content": [{ "type": "output_text", ... }] }.The official Codex client treats these as valid Responses API protocol items. It also sets
store=falsefor the ChatGPT Codex backend, so follow-up turns rely on replaying necessary history throughinput.Problem
OmniRoute previously normalized Codex requests too aggressively:
tool_search.customtools were dropped unless they looked like function tools.phase: "commentary"history was treated as an internal runtime frame and removed, even in native Codex passthrough mode.As a result, the upstream Codex backend could receive an incomplete version of the native client request.
Impact
Affected scenarios include:
apply_patch/ freeform custom tool calls./v1/responses.Without this fix, the model may be unable to discover subagent tools, unable to call native custom tools, or lose part of the assistant history between turns.
Fix
This PR keeps the behavior scoped by path:
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTargeted validation:
Results:
tests/unit/executor-codex.test.ts: 39 passed, 0 failedtests/unit/responses-input-sanitizer-name.test.ts: 8 passed, 0 failedManual integration validation:
features.multi_agent=truefeatures.multi_agent_v2=falsetool_searchreturns:multi_agent_v1.spawn_agentmulti_agent_v1.resume_agentmulti_agent_v1.close_agentmulti_agent_v1.wait_agentmulti_agent_v1.send_inputTests Added Or Updated
tests/unit/executor-codex.test.ts{ type: "tool_search" }.strict.phase: "commentary"history.Coverage Notes
The production change is limited to Codex request normalization and Responses input sanitization behavior. No migrations, UI changes, or broad routing changes are included.
Reviewer Notes
fix(codex): preserve tool_search hosted toolfix(codex): preserve native custom toolsfix(codex): preserve native assistant commentary history