Repository navigation
Description
Summary
When using Codex (OpenAI's CLI/desktop agent) through the Command Code Provider API (/provider/v1/chat/completions), any request where the assistant calls the tool_search function fails with HTTP 400. This is Codex's standard tool-discovery mechanism — every new tool (web search, MCP tools, plugin tools) requires a tool_search call first. As a result, Codex cannot use web search, MCP servers, or plugin tools at all through Command Code.
Note: this is about the Provider API gateway, not the Command Code CLI (cmd).
Expected Behavior
tool_search should be accepted as a normal function call (like any other function in tool_calls), same as OpenAI's official API and other OpenAI-compatible gateways do. Codex relies on it to discover and load tools.
Actual Behavior
HTTP 400 with an empty-ish error body. When routed through a proxy (e.g. cc-switch), the error surfaces as:
"Missing required parameter: 'input[N].arguments'"
Verified with direct API calls:
- tool_search listed in the
toolsarray (definition only): 200 OK - assistant calls tool_search in tool_calls: 400
- same request shape with a different function name (e.g. get_weather): 200 OK
This confirms the gateway specifically rejects invoking a function namedtool_search.
Steps to reproduce the issue
- POST https://api.commandcode.ai/provider/v1/chat/completions with Authorization: Bearer
- Body:
{
"model": "gpt-5.6-sol",
"messages": [
{"role": "user", "content": "hi"},
{"role": "assistant", "content": null, "tool_calls": [
{"id": "call_1", "type": "function", "function": {"name": "tool_search", "arguments": "{"limit":5,"query":"demo"}"}}
]}
],
"tools": [
{"type": "function", "function": {"name": "tool_search", "description": "Search for tools", "parameters": {"type": "object", "properties": {"query": {"type": "string"}, "limit": {"type": "integer"}}, "required": ["query"]}}}
]
} - Observe HTTP 400
- Replace "tool_search" with "get_weather" in both places → 200 OK
Command Code Version
Provider API (gateway) — subscription: GOAT plan
Operating System
Windows
Terminal/IDE
Codex desktop / Codex CLI
Shell
powershell
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
This same class of problem (strict gateways rejecting Codex's tool_search / namespace tool types) is documented in other projects:
- Responses API: ResponseToolUnion rejects "namespace" and "tool_search" tool types emitted by OpenAI Codex CLI theagentrouter/agent-router#2164: "ResponseToolUnion rejects namespace and tool_search tool types emitted by OpenAI Codex CLI"
- [P0 / Blocker] Remote compact task fails 100% with "tools.defer_loading requires tools.tool_search" — GPT-5.5 unusable at context limit, no client-side workaround openai/codex#19486: "tools.defer_loading requires tools.tool_search"
- diegosouzapw/OmniRoute PR #7571: "stop dropping tool_search in Responses->Chat translation"
The official OpenAI API accepts these calls; Command Code's gateway appears to have a gap in its Chat Completions implementation. Please either accept tool_search invocations or document the limitation.
Activity
vipulgupta2048 commentedon Aug 26, 2026
@Lv-Guu Thanks for opening a request, what model are you using?
Lv-Guu commentedon Aug 27, 2026
@vipulgupta2048 Thanks for the quick response!
Model: gpt-5.6-sol (via the Provider API /provider/v1/chat/completions, GOAT plan). I also reproduced it with gpt-5.6-terra and gpt-5.6-luna — same 400.
The key detail: the gateway rejects invoking a function named tool_search, but accepts the exact same request with any other function name. Minimal reproduction (no proxy involved — direct API call):
复制
POST https://api.commandcode.ai/provider/v1/chat/completions
Authorization: Bearer
Content-Type: application/json
{
"model": "gpt-5.6-sol",
"messages": [
{"role": "user", "content": "hi"},
{"role": "assistant", "content": null, "tool_calls": [
{"id": "call_1", "type": "function", "function": {"name": "tool_search", "arguments": "{"limit":5,"query":"demo"}"}}
]}
],
"tools": [
{"type": "function", "function": {"name": "tool_search", "description": "Search for tools", "parameters": {"type": "object", "properties": {"query": {"type": "string"}, "limit": {"type": "integer"}}, "required": ["query"]}}}
]
}
→ HTTP 400 (empty body / "Missing required parameter: 'input[N].arguments'" when surfaced through a proxy)
Change tool_search → get_weather in both places → HTTP 200.
Why this matters: tool_search is Codex's standard tool-discovery mechanism. Every new tool (web search, MCP servers, plugin tools) requires a tool_search call first. OpenAI's official API and other OpenAI-compatible gateways accept it; Command Code's Chat Completions implementation currently rejects it, which makes Codex unable to use any dynamic tools through the Provider API.
Happy to provide a curl script or session export if needed. Thanks for looking into it!
ahmadbilaldev commentedon Sep 17, 2026
Responses API support was shipped today. Try using the responses endpoint, should fix the issue.