Repository navigation
Flatten namespace tools for providers without wrappers - #29602
kotakem-openai wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42961ed49b
ℹ️ 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".
|
Any movement on this? I'd love to see this fix in main |
|
why not resolving this critical issue up to now? |
eee2c72 to
05d99c8
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Is there a new PR which resolves this? Curious why it was closed. |
|
Why was this PR closed? |
|
Hey, any info why this was closed? Does this mean OpenAI's officially saying they are not interested in allowing other models to be used on the ChatGPT/Codex app? Tibo has just tweeted about a method to use GPT models on the Claude Code app. https://x.com/thsottiaux/status/2076119366647894371?s=20 so OpenAI is sharing how to do something on someone else’s app that they don’t want you to do on their own now? |
…vider codex 0.144.x 走自定义 Responses API provider 时,model 发起 mcp__<server>__<tool> 形式的 function_call 后,codex 内部 tool dispatcher 直接返回 'unsupported call',不会转发给 MCP server。 - MCP server 加载正常 (ListToolsRequest 成功) - tools 数组里 [namespace] mcp__<server> 正确暴露给模型 - 模型正确发起 namespace 格式 function_call - codex 返回 unsupported call,MCP server 日志无 CallToolRequest - 手动 mcpServer/tool/call JSON-RPC 正常 - 试过 config_overrides / ~/.codex/config.toml / non_prefixed_mcp_tool_names / model_catalog_json 都不能修复 临时 workaround:不传 mcp_servers config,demo tools 走 AGENTS.md 的 bash 方案。清理掉不再使用的 _DEMO_MCP_SCRIPT / _PYTHON_BIN 死代码。 Refs: openai/codex#22970 (comment) openai/codex#25139 openai/codex#26977 openai/codex#30902 openai/codex#31354 openai/codex#29602
Checked before filing: the namespace_tools defect is already reported upstream as openai#26234 (open since 2026-06-03, `bug`, 29 comments, reference branch attached) and openai#33263. Two fix PRs, openai#28271 and openai#29602, were authored by an OpenAI engineer and both closed unmerged without explanation. So this is not a transitional patch awaiting an upstream fix — plan to carry it. Records the evidence, and notes that openai#26234's per-provider `namespace_tools` config (defaulting to `requires_openai_auth`) is a better shape than our global feature flag if we revisit it.
Summary
Resolves #26234.
Codex uses the OpenAI Responses API
type: "namespace"wrapper to serialize namespaced tools. Support for that wire format is not universal among third-party Responses-compatible endpoints: some reject it, while others may not preserve its namespace semantics. On endpoints that only support plain function tools, this can prevent MCP tools, deferredtool_searchresults, and standalone extension tools from being exposed or called correctly.This change adds a Codex-side compatibility fallback rather than requiring those endpoints to implement namespace wrappers. Codex keeps its logical namespaced tool model internally, but serializes model-visible tools based on the provider's
namespace_toolsconfiguration/default: preserve namespace wrappers when enabled, or emit canonical flattened function names when disabled. Flat calls are resolved back to the original namespaced runtime, preserving logical tool identity.What Changed
namespace_toolsprovider capability/config plumbing. Explicit config wins; OpenAI-auth and Azure Responses providers preserve wrappers by default; configured non-OpenAI Responses providers flatten by default; Amazon Bedrock keeps wrappers by default but can opt out withnamespace_tools = false.type: "namespace"when supported, otherwise emit canonical<namespace>__<tool>function names for direct tools and deferredtool_searchresults.PreToolUseandPostToolUsehook matching compatible with model-visible flat names via matcher-only aliases, while preserving the existing canonical hook name in hook stdin.web.run/image_gen.imagegen.tool_search. Hidden/unreachable-only collisions keep their logical runtimes while warning and suppressing the ambiguous flat alias.namespace_toolsthrough remote thread config and regenerated the config schema.Test Plan
just write-config-schemajust test -p codex-toolsjust test -p codex-protocol tool_namejust test -p codex-model-providerjust test -p codex-config thread_configjust test -p codex-mcpjust test -p codex-core mcp_and_tool_search_follow_direct_and_deferred_tool_exposure search_results_flatten_mcp_namespaces_without_namespace_tools handler_resolves_flat_aliases_when_namespace_specs_are_flattened responses_lite_flattens_standalone_tools_without_namespace_toolscodex-coreregressions for model-reachable/discoverable canonical-flat collisions, hidden-only alias suppression, flat registry dispatch, and flattenedPreToolUse/PostToolUsehook matcher aliases.just test -p codex-protocol -p codex-config -p codex-model-provider-info -p codex-loginjust test -p codex-app-servercodexbinary and a local Ollama Responses API endpoint: observedPASS: Codex flattened the MCP tool for the custom Responses backend.Documentation
model_providers.<id>.namespace_toolsand its provider defaults in the Codex model provider/configuration documentation on developers.openai.com.