Client or integration
Codex App
Provider or upstream service
AI2API - an internal corporate gateway speaking the OpenAI Responses API (opencodex provider config: adapter: "openai-responses", authMode: "key"), serving Moonshot kimi-k3. The endpoint is internal-only; there is no public hostname or public specification for the gateway itself.
OpenCodex version
2.51.0 (npm @bitkyc08/opencodex). Also source-checked against dev: webSearchBridge (#4142) is present, but src/web-search/passthrough-bridge.ts still states that only the ollama backend has a shipped executor today.
Endpoint or capability
/v1/responses - hosted web_search tool on a key-auth Responses passthrough route
Current behaviour
Codex App declares the hosted {type: "web_search"} tool on the request. On this route the model answers with a function_call item named web_search. A hosted declaration never authorizes a client function of that name, so the undeclared-tool guard fails the stream, Codex App retries up to 5/5, and the turn dies.
This is the same failure class as #3761 (Ollama Cloud). #4142 shipped providers.<name>.webSearchBridge for exactly this shape, but its only shipped executor posts to Ollama's /api/web_search. PROVIDER_WEB_SEARCH_BRIDGE_BACKENDS admits openai/anthropic/xai/gemini/exa as explicit-but-inert, so a non-Ollama key-auth gateway cannot arm the bridge at all.
Expected behaviour
A key-auth Responses passthrough provider that is not Ollama Cloud can opt into the #4142 bridge with a working search executor - for example by reusing the existing sidecar executors (openai/anthropic/xai/gemini/exa) in the bridge path - so the intercepted web_search call is executed proxy-side, the call and its result continue the upstream conversation, and Codex receives the hosted web_search_call cell, exactly as the Ollama backend already does.
Minimal redacted request or reproduction
// ~/.opencodex/config.json (redacted)
{
"providers": {
"AI2API": {
"adapter": "openai-responses",
"baseUrl": "https://<internal-host>/v1",
"authMode": "key",
"apiKey": "<redacted>",
"defaultModel": "kimi-k3"
}
}
}
Then run any Codex App turn on that route with web search enabled where the model decides to search (for example, asking for the latest status of an external project). Non-search turns on the same route complete normally.
Actual response or error
stream disconnected before completion: routed provider emitted undeclared client tool "web_search"; only request-declared tools may be called
Codex App shows "Reconnecting 1/5 ... 5/5" and the turn fails. Screenshot available on request.
Upstream documentation
https://developers.openai.com/api/docs/guides/tools-web-search - hosted web_search returns web_search_call output items; a provider-side search is not a client function_call. The gateway itself is internal and publishes no specification.
Suggested mapping or implementation notes
Additional context and attachments
Checks
Client or integration
Codex App
Provider or upstream service
AI2API - an internal corporate gateway speaking the OpenAI Responses API (opencodex provider config:
adapter: "openai-responses",authMode: "key"), serving Moonshotkimi-k3. The endpoint is internal-only; there is no public hostname or public specification for the gateway itself.OpenCodex version
2.51.0 (npm
@bitkyc08/opencodex). Also source-checked againstdev:webSearchBridge(#4142) is present, butsrc/web-search/passthrough-bridge.tsstill states that only the ollama backend has a shipped executor today.Endpoint or capability
/v1/responses- hostedweb_searchtool on a key-auth Responses passthrough routeCurrent behaviour
Codex App declares the hosted
{type: "web_search"}tool on the request. On this route the model answers with afunction_callitem namedweb_search. A hosted declaration never authorizes a client function of that name, so the undeclared-tool guard fails the stream, Codex App retries up to 5/5, and the turn dies.This is the same failure class as #3761 (Ollama Cloud). #4142 shipped
providers.<name>.webSearchBridgefor exactly this shape, but its only shipped executor posts to Ollama's/api/web_search.PROVIDER_WEB_SEARCH_BRIDGE_BACKENDSadmitsopenai/anthropic/xai/gemini/exaas explicit-but-inert, so a non-Ollama key-auth gateway cannot arm the bridge at all.Expected behaviour
A key-auth Responses passthrough provider that is not Ollama Cloud can opt into the #4142 bridge with a working search executor - for example by reusing the existing sidecar executors (
openai/anthropic/xai/gemini/exa) in the bridge path - so the interceptedweb_searchcall is executed proxy-side, the call and its result continue the upstream conversation, and Codex receives the hostedweb_search_callcell, exactly as the Ollama backend already does.Minimal redacted request or reproduction
Then run any Codex App turn on that route with web search enabled where the model decides to search (for example, asking for the latest status of an external project). Non-search turns on the same route complete normally.
Actual response or error
Codex App shows "Reconnecting 1/5 ... 5/5" and the turn fails. Screenshot available on request.
Upstream documentation
https://developers.openai.com/api/docs/guides/tools-web-search - hosted
web_searchreturnsweb_search_calloutput items; a provider-side search is not a clientfunction_call. The gateway itself is internal and publishes no specification.Suggested mapping or implementation notes
webSearchBridge. The sidecar executors already implement the search itself; wiring them into the bridge path would cover arbitrary key-auth Responses gateways without new search-provider integrations. The credential/endpoint scoping policy called out in [Provider compatibility] Ollama Cloud Responses passthrough skips web-search sidecar; hosted web_search is echoed as a client function_call #3761 still applies.$web_searchmay auto-execute server-side before the relay emits the call. Whether the relay expects a tool result back (the bridge continuation leg fits) or would have continued within the same response needs a live probe against the gateway; happy to run one and report back.Additional context and attachments
Checks