Skip to content

openai-responses transport sends null content, rejected by strict providers (400 schema error) #90094

Description

@xneone

Bug

When using api: "openai-responses", the gateway sends messages where content is null in the input array. Strict OpenAI-compatible providers (e.g., weelinking) reject these requests with 400, while OpenAI's own API tolerates null content.

Error

400 Invalid type for 'input[3].content': expected one of an array of objects or string, but got null instead.

Gateway log:

[responses] error provider=wlkgpt api=openai-responses model=gpt-5.5 name=Error status=400 code=bad_response_status_code type=bad_response_status_code message=400 openai_error
providerRuntimeFailureKind: schema
failoverReason: format

Configuration

{
  "wlkgpt": {
    "baseUrl": "https://api.weelinking.com/v1",
    "api": "openai-responses",
    "models": [{ "id": "gpt-5.5", "reasoning": true }]
  }
}

Environment

  • openclaw version: 2026.6.2-beta.1
  • Provider: weelinking (only supports openai-responses format)
  • Model: gpt-5.5
  • Channel: feishu

Expected Behavior

The gateway should sanitize the input array before sending: replace content: null with either an empty string "" or omit the message. This matches OpenAI's documented schema which requires content to be string | array.

Actual Behavior

Messages with content: null (likely from tool_use / tool_result entries in the conversation history) are passed through verbatim, causing strict providers to reject the entire request.

Workaround

None found. The error persists across session resets and gateway restarts.

Suggested Fix

In the openai-responses transport layer, before serializing the request payload, filter/transform messages:

input = input.map(msg => ({
  ...msg,
  content: msg.content ?? (Array.isArray(msg.tool_calls) || msg.tool_call_id ? msg.content : "")
}));

Or strip messages where content is null and the message type doesn't require it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions