codex - 💡(How to fix) Fix Bug: `web_search_call` items in conversation history crash when switching to Ollama/custom provider

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a thread uses an OpenAI model (e.g. GPT-5.5) that invokes the web search tool, the conversation history accumulates web_search_call input items. If you then switch to an Ollama/custom model provider in the same thread, Codex forwards the entire history — including those web_search_call items — to the new provider. The provider rejects the request with:

{"error":{"message":"input[14]: unknown input item type: \"web_search_call\"","type":"invalid_request_error","param":null,"code":null}}

Error Message

{"error":{"message":"input[14]: unknown input item type: "web_search_call"","type":"invalid_request_error","param":null,"code":null}}

Root Cause

Codex uses wire_api = "responses" for all providers (the "chat" wire API is no longer supported). When sending conversation history to a model provider, Codex does not strip or convert Responses API-specific input item types (web_search_call, web_search_call_output) that the target provider doesn't support.

The model catalog correctly marks supports_search_tool: false for Ollama models, but this flag only prevents Codex from initiating new web searches — it does not cause Codex to strip existing web search items from the history before forwarding.

Fix Action

Workaround

Start a new conversation thread when switching from an OpenAI model to an Ollama/custom provider. A fresh thread has no web_search_call items in the history.

Code Example

{"error":{"message":"input[14]: unknown input item type: \"web_search_call\"","type":"invalid_request_error","param":null,"code":null}}

---

[profiles.ollama-launch-codex-app]
model = "glm-5.1:cloud"
openai_base_url = "http://127.0.0.1:11434/v1/"
model_provider = "ollama-launch-codex-app"
model_catalog_json = "/Users/username/.codex/ollama-launch-models.json"

[model_providers.ollama-launch-codex-app]
name = "Ollama"
base_url = "http://127.0.0.1:11434/v1/"
wire_api = "responses"
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.41501 (3044)

What subscription do you have?

Plus

What platform is your computer?

No response

What issue are you seeing?

Summary

When a thread uses an OpenAI model (e.g. GPT-5.5) that invokes the web search tool, the conversation history accumulates web_search_call input items. If you then switch to an Ollama/custom model provider in the same thread, Codex forwards the entire history — including those web_search_call items — to the new provider. The provider rejects the request with:

{"error":{"message":"input[14]: unknown input item type: \"web_search_call\"","type":"invalid_request_error","param":null,"code":null}}

Steps to Reproduce

  1. Start a Codex thread using an OpenAI model (e.g. GPT-5.5)
  2. Ask a question that triggers a web search (e.g. "search the web for today's news")
  3. Switch the model to an Ollama/custom provider (e.g. glm-5.1:cloud via Ollama)
  4. Send another message in the same thread
  5. Request fails with unknown input item type: "web_search_call"

Root Cause

Codex uses wire_api = "responses" for all providers (the "chat" wire API is no longer supported). When sending conversation history to a model provider, Codex does not strip or convert Responses API-specific input item types (web_search_call, web_search_call_output) that the target provider doesn't support.

The model catalog correctly marks supports_search_tool: false for Ollama models, but this flag only prevents Codex from initiating new web searches — it does not cause Codex to strip existing web search items from the history before forwarding.

Expected Behaviour

Codex should filter out web_search_call and web_search_call_output items from the conversation history when sending to a provider where supports_search_tool is false (or where the provider otherwise cannot handle those item types).

Workaround

Start a new conversation thread when switching from an OpenAI model to an Ollama/custom provider. A fresh thread has no web_search_call items in the history.

Environment

  • Codex CLI v0.130.0
  • macOS (Apple Silicon)
  • Custom model provider: Ollama (wire_api = "responses", base_url = "http://127.0.0.1:11434/v1/")
  • Model catalog includes supports_search_tool: false and supports_parallel_tool_calls: false

Config Snippet

[profiles.ollama-launch-codex-app]
model = "glm-5.1:cloud"
openai_base_url = "http://127.0.0.1:11434/v1/"
model_provider = "ollama-launch-codex-app"
model_catalog_json = "/Users/username/.codex/ollama-launch-models.json"

[model_providers.ollama-launch-codex-app]
name = "Ollama"
base_url = "http://127.0.0.1:11434/v1/"
wire_api = "responses"

What steps can reproduce the bug?

  1. Start a Codex thread using an OpenAI model (e.g. GPT-5.5)
  2. Ask a question that triggers a web search (e.g. "search the web for today's news")
  3. Switch the model to an Ollama/custom provider (e.g. glm-5.1:cloud via Ollama)
  4. Send another message in the same thread
  5. Request fails with unknown input item type: "web_search_call"

What is the expected behavior?

Codex should filter out web_search_call and web_search_call_output items from the conversation history when sending to a provider where supports_search_tool is false (or where the provider otherwise cannot handle those item types).

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Bug: `web_search_call` items in conversation history crash when switching to Ollama/custom provider