ollama - 💡(How to fix) Fix OpenAI Compatibility: Support namespace field in tool calls for Responses API parity [1 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
ollama/ollama#15921Fetched 2026-05-02 05:27:40
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

What is the issue?

The OpenAI "Responses API" (used by tools like Codex CLI) has introduced namespaced tool calling. This allows tools to be grouped (e.g., mcp__tilth__.search) and expects a response format that includes a top-level namespace field alongside the tool name.

Currently, Ollama flattens these into a single name string in the /v1/chat/completions output. This prevents clients that strictly follow the Responses API (like Codex) from resolving the tool call correctly, as they expect the namespace field to be preserved if it was provided in the initial tool spec.

Reproduction Details

  1. Provide a tool definition to Ollama that includes a namespace field (or is grouped under a namespace type as seen in the newer Responses API).
  2. Have the model call that tool.
  3. Observe the output JSON.
  4. Actual: {"tool_calls": [{"function": {"name": "mcp__server__tool_name", ...}}]}
  5. Expected (for Responses API parity): {"tool_calls": [{"function": {"name": "tool_name", "namespace": "mcp__server__", ...}}]}

Relevant log output

N/A (This is a protocol compatibility issue in the OpenAI-compatible translation layer).

Environment

  • OS: Windows 11 / Linux
  • Ollama version: 0.4.7+

extent analysis

TL;DR

Update Ollama to preserve the namespace field in the /v1/chat/completions output to ensure compatibility with the OpenAI Responses API.

Guidance

  • Verify that the tool definition provided to Ollama includes a namespace field or is grouped under a namespace type.
  • Check the Ollama version (currently 0.4.7+) to ensure it supports the newer Responses API format.
  • Modify the Ollama code to preserve the namespace field in the output JSON, if possible.
  • Test the updated Ollama with the Codex CLI to ensure correct tool call resolution.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue is specific to the OpenAI Responses API and Ollama's compatibility with it. The solution may require updates to Ollama's code or configuration.

Recommendation

Apply workaround: Update Ollama to preserve the namespace field in the output JSON to ensure compatibility with the OpenAI Responses API. This is necessary to resolve the tool call correctly in clients like Codex.

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

ollama - 💡(How to fix) Fix OpenAI Compatibility: Support namespace field in tool calls for Responses API parity [1 participants]