[PR #812] [CLOSED] serve: Codex MCP tools (web search) fail as 'unsupported call': map namespace__name calls back to their namespace #2844

Closed
opened 2026-11-04 02:03:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/812
Author: @robwijnhoven
Created: 10/4/2026
Status: ❌ Closed

Base: main ← Head: serve-namespace-double-underscore


📝 Commits (1)

  • 1417ed4 serve: map namespace calls written as namespace__name back to their namespace

📊 Changes

2 files changed (+20 additions, -0 deletions)

View changed files

📝 serve/responses.py (+4 -0)
📝 serve/test_responses.py (+16 -0)

📄 Description

Related to #451.

Problem

Codex sends its MCP tools as namespace tools, e.g. {"type": "namespace", "name": "mcp__websearch", "tools": [{"type": "function", "name": "web_search", ...}]}. The Responses adapter presents that tool to the model as mcp__websearch.web_search and maps that name back to (namespace, name) for the function_call item.

Qwen3.8-Flash-Next (IQ3_S) does not write the dotted name. It writes mcp__websearch__web_search, the flat form Codex has long used for MCP tools. That spelling has no entry in the reverse map, so the call comes back as a plain function mcp__websearch__web_search with no namespace, and Codex refuses it:

ERROR codex_core::tools::router: error=unsupported call: mcp__websearch__web_search

So MCP tools (web search here) never run through Codex on Strata, while the model is calling them correctly in spirit.

Fix

request_tools also registers f"{namespace}__{name}" for every namespaced tool, with setdefault, so a real tool that happens to carry that exact flat name still wins. The call then comes back with namespace: "mcp__websearch", name: "web_search", and Codex runs it.

Validation

  • New test test_namespace_call_written_with_double_underscore (over HTTP, MockEngine): fails before the change, passes after.
  • python -m unittest serve.test_responses in a Docker build of v0.1.39 (Linux, CUDA image): 20 tests, all new and existing namespace/custom-call tests pass. One error, test_json_schema_text_format, also fails on an unmodified v0.1.39 image here (r["error"] is None), so it is unrelated to this change.
  • Real use: Codex CLI 0.160.0 → Strata 0.1.39 (IQ3_S, RTX 3090, 262K context) with a streamable-HTTP MCP search server. Before: unsupported call: mcp__websearch__web_search on every attempt. After: mcp: websearch/web_search (completed) and the result reached the model. A 4-turn shell tool loop in the same setup worked before and after.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/812 **Author:** [@robwijnhoven](https://github.com/robwijnhoven) **Created:** 10/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `serve-namespace-double-underscore` --- ### 📝 Commits (1) - [`1417ed4`](https://github.com/Niko1221/Strata/commit/1417ed4c9b0c0d15e459b068a6ff2723cd9d0aae) serve: map namespace calls written as namespace__name back to their namespace ### 📊 Changes **2 files changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `serve/responses.py` (+4 -0) 📝 `serve/test_responses.py` (+16 -0) </details> ### 📄 Description Related to #451. ## Problem Codex sends its MCP tools as `namespace` tools, e.g. `{"type": "namespace", "name": "mcp__websearch", "tools": [{"type": "function", "name": "web_search", ...}]}`. The Responses adapter presents that tool to the model as `mcp__websearch.web_search` and maps that name back to `(namespace, name)` for the `function_call` item. Qwen3.8-Flash-Next (IQ3_S) does not write the dotted name. It writes `mcp__websearch__web_search`, the flat form Codex has long used for MCP tools. That spelling has no entry in the reverse map, so the call comes back as a plain function `mcp__websearch__web_search` with no `namespace`, and Codex refuses it: ``` ERROR codex_core::tools::router: error=unsupported call: mcp__websearch__web_search ``` So MCP tools (web search here) never run through Codex on Strata, while the model is calling them correctly in spirit. ## Fix `request_tools` also registers `f"{namespace}__{name}"` for every namespaced tool, with `setdefault`, so a real tool that happens to carry that exact flat name still wins. The call then comes back with `namespace: "mcp__websearch"`, `name: "web_search"`, and Codex runs it. ## Validation - New test `test_namespace_call_written_with_double_underscore` (over HTTP, MockEngine): fails before the change, passes after. - `python -m unittest serve.test_responses` in a Docker build of v0.1.39 (Linux, CUDA image): 20 tests, all new and existing namespace/custom-call tests pass. One error, `test_json_schema_text_format`, also fails on an unmodified v0.1.39 image here (`r["error"]` is None), so it is unrelated to this change. - Real use: Codex CLI 0.160.0 → Strata 0.1.39 (IQ3_S, RTX 3090, 262K context) with a streamable-HTTP MCP search server. Before: `unsupported call: mcp__websearch__web_search` on every attempt. After: `mcp: websearch/web_search (completed)` and the result reached the model. A 4-turn shell tool loop in the same setup worked before and after. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2844
No description provided.