[PR #1918] [CLOSED] serve: run Codex's client-side tool_search #3756

Closed
opened 2026-11-07 15:30:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1918
Author: @msola-ht
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: codex-tool-search


📝 Commits (3)

  • 719d9c6 feat(responses): 支持 Codex 客户端的 tool_search
  • 27c2f3d refactor(responses): tool_search 保留上游对重复声明的处理
  • a8bbfa7 fix(responses): tool_search 不对重复声明报错

📊 Changes

2 files changed (+60 additions, -8 deletions)

View changed files

📝 docs/DETAILS.md (+2 -2)
📝 serve/responses.py (+58 -6)

📄 Description

Fixes #1917.

Codex (CLI and Desktop, Responses wire API) declares its deferred tool discovery as
{"type": "tool_search", "execution": "client"} with no name. serve/responses.py listed tool_search in
HOSTED_TOOLS, so the declaration was dropped and the model never saw it: a Responses client could not reach the
tools it keeps in reserve, and the search that same client runs itself had no way to start.

What this changes

  • tool_search is declared to the model as the ordinary function tool_search. The model can only call it, the
    client runs the search and answers, and the call goes back as a tool_search_call item (execution: "client",
    arguments as an object, no name, no argument deltas, incomplete if the turn runs out of tokens).
  • tool_search_call and tool_search_output are read back from input: the call is replayed as the tool_search
    call it was, and the tools the search found are declared for that prompt the same way an additional_tools item is
    read (#782) - a namespace of found tools included.
  • A tool_search a client marks for some other host to run is still left out, like the other hosted tools.

What it leaves alone

Web search and the other hosted tools are still left out (this server cannot run them) and tool_choice still cannot
force a tool. Nothing changes for a request that does not declare tool_search: no new config key and no new
default - the client's own declaration is the opt-in, as it is for additional_tools (#782) and the
namespace__name mapping (#812).

How I checked

  • python -m unittest serve.test_responses: 40 tests, 1 skipped, no failures.
  • Every new path observed through the Responses API: the declaration, both input items, a search result whose tool
    is then called, execution: "server" still dropped, and a request with a repeated tool declaration unchanged.
  • End to end against a real Codex 0.160 client and an engine: tool_search_call -> tool_search_output -> the model
    calling a tool that only the search had returned.

Not covered: the suite has no test for tool_search, and the wire shapes come from measured Codex traffic rather
than a published specification.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1918 **Author:** [@msola-ht](https://github.com/msola-ht) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex-tool-search` --- ### 📝 Commits (3) - [`719d9c6`](https://github.com/Niko1221/Strata/commit/719d9c67df67a251e2b21f87f91f92eaf90e1fcd) feat(responses): 支持 Codex 客户端的 tool_search - [`27c2f3d`](https://github.com/Niko1221/Strata/commit/27c2f3d146197a15368cbd86111ac697847521b6) refactor(responses): tool_search 保留上游对重复声明的处理 - [`a8bbfa7`](https://github.com/Niko1221/Strata/commit/a8bbfa7dba8fa5f11bd9f2c5d9532f01cdeb370b) fix(responses): tool_search 不对重复声明报错 ### 📊 Changes **2 files changed** (+60 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+2 -2) 📝 `serve/responses.py` (+58 -6) </details> ### 📄 Description Fixes #1917. Codex (CLI and Desktop, Responses wire API) declares its deferred tool discovery as `{"type": "tool_search", "execution": "client"}` with no `name`. `serve/responses.py` listed `tool_search` in `HOSTED_TOOLS`, so the declaration was dropped and the model never saw it: a Responses client could not reach the tools it keeps in reserve, and the search that same client runs itself had no way to start. ## What this changes - `tool_search` is declared to the model as the ordinary function `tool_search`. The model can only call it, the client runs the search and answers, and the call goes back as a `tool_search_call` item (`execution: "client"`, `arguments` as an object, no `name`, no argument deltas, `incomplete` if the turn runs out of tokens). - `tool_search_call` and `tool_search_output` are read back from `input`: the call is replayed as the `tool_search` call it was, and the tools the search found are declared for that prompt the same way an `additional_tools` item is read (#782) - a `namespace` of found tools included. - A `tool_search` a client marks for some other host to run is still left out, like the other hosted tools. ## What it leaves alone Web search and the other hosted tools are still left out (this server cannot run them) and `tool_choice` still cannot force a tool. Nothing changes for a request that does not declare `tool_search`: no new config key and no new default - the client's own declaration is the opt-in, as it is for `additional_tools` (#782) and the `namespace__name` mapping (#812). ## How I checked - `python -m unittest serve.test_responses`: 40 tests, 1 skipped, no failures. - Every new path observed through the Responses API: the declaration, both input items, a search result whose tool is then called, `execution: "server"` still dropped, and a request with a repeated tool declaration unchanged. - End to end against a real Codex 0.160 client and an engine: `tool_search_call` -> `tool_search_output` -> the model calling a tool that only the search had returned. Not covered: the suite has no test for `tool_search`, and the wire shapes come from measured Codex traffic rather than a published specification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3756
No description provided.