Skip to content

Provider API rejects tool_search function calls from Codex clients with 400 "Missing required parameter: 'input[N].arguments'" #745

Description

@Lv-Guu

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 tools array (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 named tool_search.

Steps to reproduce the issue

  1. POST https://api.commandcode.ai/provider/v1/chat/completions with Authorization: Bearer
  2. 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"]}}}
    ]
    }
  3. Observe HTTP 400
  4. 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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions