Track translated Responses hosted/deferred tool semantics
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 85
- Forks
- 33
- Avg merge
- 45m
- Merged PRs (30d)
- 10
Description
Context
Codex sends OpenAI Responses tool entries such as tool_search and namespace for client-executed deferred tool discovery. That path is used to discover tools that are not eagerly sent in the initial request, including built-in subagent tools. Native Responses targets need to see those entries unchanged so the model can emit tool_search_call, the client can execute it locally, and the follow-up tool_search_output can expose the deferred tool definitions.
The gateway source cleanup should only remove upstream-incompatible image_generation entries. This issue tracks the remaining non-native target behavior when the planner translates a Responses request to Messages or Chat Completions.
Current behavior
packages/translate/src/responses-via-messages/request.tsnarrowstoolsto Responsesfunctionand Freeformcustomentries. Hosted/deferred entries such asweb_search,tool_search,namespace, andimage_generationare skipped.packages/translate/src/responses-via-chat-completions/request.tsdoes the same narrowing for Chat Completions.- Forced hosted/deferred
tool_choicevalues have no target equivalent today and translate toundefinedon Messages/Chat paths.
This is acceptable as a documented gap only if the planner/source boundary prevents silent loss for requests that require those tools. It is not a faithful bridge for Codex tool_search/namespace semantics.
Risk
If a Codex Responses request containing tool_search or namespace is routed through a translated target, the selected upstream model will not see the discovery tools and cannot emit tool_search_call. That breaks deferred tool discovery and can make built-in subagent tools unavailable even though the native Responses path would work.
References
- OpenAI Codex
ToolSpec::ToolSearch/Namespace: https://github.com/openai/codex/blob/9f42c89c0112771dc29100a6f3fc904049b2655f/codex-rs/tools/src/tool_spec.rs#L17-L27 - OpenAI Codex router handles client-executed
ToolSearchCall: https://github.com/openai/codex/blob/9f42c89c0112771dc29100a6f3fc904049b2655f/codex-rs/core/src/tools/router.rs#L106-L123 - OpenAI Codex tool search output shape: https://github.com/openai/codex/blob/9f42c89c0112771dc29100a6f3fc904049b2655f/codex-rs/core/src/tools/context.rs#L166-L180
- OpenAI Codex tests for default
tool_searchand multi-agent namespace discovery: https://github.com/openai/codex/blob/9f42c89c0112771dc29100a6f3fc904049b2655f/codex-rs/core/tests/suite/search_tool.rs#L116-L158 and https://github.com/openai/codex/blob/9f42c89c0112771dc29100a6f3fc904049b2655f/codex-rs/core/tests/suite/search_tool.rs#L680-L768 - caozhiyuan/copilot-api keeps
tool_search/namespaceand only stripsimage_generationby default: https://github.com/caozhiyuan/copilot-api/blob/5d37d5b1ac6566c935a5c26d046396ee5fa423cc/src/routes/responses/handler.ts#L187-L204 - Related OpenAI Codex issue around non-native
tool_searchhandling: https://github.com/openai/codex/issues/20574
Acceptance criteria
- Native Responses requests preserve
web_search,tool_search, andnamespacetool entries and matching forcedtool_choicevalues. - Responses-to-Messages and Responses-to-Chat behavior for hosted/deferred tools is explicit: either bridge the supported subset, reject requests that require unbridgeable semantics, or document intentional lossy behavior at the source/planner boundary.
- Tests cover translated
toolsand forcedtool_choicebehavior forweb_search,tool_search, andnamespace. TRANSLATION.mdstates the final policy clearly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/translate/src/responses-via-messages/request.ts and packages/translate/src/responses-via-chat-completions/request.ts, then inspect the existing translation tests and TRANSLATION.md. Trace how Responses tools and forced tool_choice values are handled for native and translated targets. Done means the supported policy is explicit, relevant tool and choice cases are covered by tests, and TRANSLATION.md documents the remaining behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100