Skip to content

[Provider compatibility] Key-auth Responses gateway (Kimi K3) echoes hosted web_search as client function_call; webSearchBridge executor is Ollama-only #4429

Description

@mdwsk88

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

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions