Skip to content

Agent zero-fills optional MCP tool parameters on OpenAI models (Responses-API tools sent with strict: None) #59393

Description

@caseymanos

Reproduction steps

  1. Connect an MCP / context server that exposes a tool with an optional parameter — a property not listed in the schema's required array. (This example uses an optional format: uuid field, but the issue is the optional-ness, not the format.) Example tool input schema:
    {
      "type": "object",
      "properties": {
        "message": { "type": "string" },
        "chat_id": { "type": "string", "format": "uuid" }
      },
      "additionalProperties": false
    }
    (No required array → both fields are optional.)
  2. Set the Agent Panel model to OpenAI GPT-5.5 (ChatGPT subscription provider, openai-subscribed).
  3. In the Agent Panel, ask the agent to call the tool in a way that should leave the optional field out (e.g. "send this message and start a new conversation — don't pass chat_id").
  4. Expand the tool call and inspect its Raw Input.

Current vs. Expected behavior

Current: The emitted tool call always includes the optional field, zero-filled. For the uuid field it sends the nil UUID:

{ "message": "", "chat_id": "00000000-0000-0000-0000-000000000000" }

This persists even after the agent's own reasoning explicitly says it will omit chat_id — the next attempt still contains 00000000-0000-0000-0000-000000000000. The MCP server then rejects the call (the id resolves to no record).

Expected: The optional field is omitted:

{ "message": "" }

Evidence this is client-side, not the model: the same MCP tool and the same GPT-5.5 model omit the optional field correctly in OpenAI's Codex CLI and in Claude Code / direct Responses-API calls. Only Zed's agent zero-fills it.

Suspected cause: crates/open_ai/src/completion.rsinto_open_ai_response() (line 235) builds the Responses-API tool with strict: None and passes the tool's input_schema through unmodified. With OpenAI structured-output / strict tool calling disabled, GPT-5.x tends to populate every property it sees — including optional ones — with zero-values. (strict: Some(true) / supports_strict appear nowhere in the tree, so strict tool calling is never enabled in any provider path.) Enabling strict tool calling — all properties in required, optional fields expressed as nullable type unions per OpenAI's strict-schema rules — should let the model omit/null optional params, matching Codex.

Not version-specific: strict: None at completion.rs:235 is identical on v1.5.5 (this report), v1.6.3 (latest stable), and v1.7.2-pre.

Zed version and system specs

Zed: v1.5.5+stable.303.8feb848bfa7e498b49589571434afef0008433b1 (Zed)
OS: macOS 26.3
Memory: 24 GiB
Architecture: aarch64

(for AI issues) Model provider details

  • Provider: OpenAI via ChatGPT subscription (openai-subscribed)
  • Model Name: GPT-5.5 (thinking enabled, effort: medium)
  • Mode: Agent Panel
  • Other details: MCP / context server tool with an optional format: uuid parameter. Same tool + same model omit the field correctly in OpenAI Codex CLI and Claude Code — so the divergence is in Zed's request construction (tools sent with strict: None), not the model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai/mcpModel Context Protocolstate:needs reproNeeds reproduction steps and/or someone to reproduce

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions