Skip to content

feat: search_tool migrate to bring you own tool of Responses API#14274

Merged
apanasenko-oai merged 3 commits intomainfrom
anton_panasenko_search_tool_client
Mar 12, 2026
Merged

feat: search_tool migrate to bring you own tool of Responses API#14274
apanasenko-oai merged 3 commits intomainfrom
anton_panasenko_search_tool_client

Conversation

@apanasenko-oai
Copy link
Collaborator

Why

to support a new bring your own search tool in Responses API(https://developers.openai.com/api/docs/guides/tools-tool-search#client-executed-tool-search) we migrating our bm25 search tool to use official way to execute search on client and communicate additional tools to the model.

What

  • replace the legacy search_tool_bm25 flow with client-executed tool_search
  • add protocol, SSE, history, and normalization support for tool_search_call and tool_search_output
  • return namespaced Codex Apps search results and wire namespaced follow-up tool calls back into MCP dispatch

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81e294a3da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_client branch from a5d907a to f99b756 Compare March 11, 2026 17:39
@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_client branch 5 times, most recently from aba8b4f to 763ab20 Compare March 11, 2026 21:43
}

#[test]
fn normalize_keeps_server_tool_search_output_without_matching_call() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, debug

@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_client branch 2 times, most recently from 53c413b to 864bb31 Compare March 11, 2026 23:40
@@ -1839,6 +1860,59 @@ pub(crate) fn mcp_tool_to_openai_tool(
fully_qualified_name: String,
tool: rmcp::model::Tool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, add defer to mcp_tool_to_openai_tool ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did go with separate mcp_tool_to_deferred_openai_tool to avoid creating noise and updating every call site of mcp_tool_to_openai_tool.

}

#[test]
fn handler_looks_up_namespaced_aliases_explicitly() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should add an intergration test that calls a tool via namespace instead.

}

pub(crate) async fn parse_mcp_tool_name(&self, tool_name: &str) -> Option<(String, String)> {
pub(crate) async fn parse_mcp_tool_name(
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need namespace here? Won't the function call come back with the correct "namespace" and "name" on it considering all the calculations are happening on mcp manager level?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mcp operates on qualified names, for apps we split them on namespace and tool name, when we do lookup for mcp handler, we need to combine them back together.

Copy link
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

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

Mostly good but something isn't right with tool naming for code mode

@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_client branch 3 times, most recently from 8fa039f to c1e5374 Compare March 12, 2026 00:13
@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_client branch from c1e5374 to 9f006ad Compare March 12, 2026 00:26
@apanasenko-oai apanasenko-oai merged commit 77b0c75 into main Mar 12, 2026
32 checks passed
@apanasenko-oai apanasenko-oai deleted the anton_panasenko_search_tool_client branch March 12, 2026 00:51
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants