openclaw - ✅(Solved) Fix openai-completions sends 'store' param that breaks non-OpenAI endpoints (e.g. Google Gemma) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61826Fetched 2026-04-08 02:53:58
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

Error Message

This is added automatically by the OpenAI JS SDK (OpenAI/JS 6.26.0), but Google's OpenAI-compatible layer rejects unknown fields with a 400 error: "error": {

PR fix notes

PR #61939: fix(openai-completions): prevent store:false for Google AI endpoints

Description (problem / solution / changelog)

Summary

The openai-completions streaming transport was sending store: false to Google AI endpoints (Gemma, Vertex AI) which don't support this parameter, resulting in 400 errors: Unknown parameter: store.

Root Cause

Google AI endpoints (generativelanguage.googleapis.com) were not included in the isNonStandard list in openai-completions-compat.ts. This meant the supportsStore logic could incorrectly evaluate to true for these endpoints, causing store: false to be included in the request body.

Fix

Add google-generative-ai and google-vertex to the isNonStandard list, which ensures supportsStore evaluates to false for these endpoints and store: false is not sent.

Testing

  • TypeScript compilation passes
  • No existing tests cover this specific scenario (Google AI with openai-completions API)

Before

After

store parameter is not sent to Google AI endpoints.

Fixes #61826

Changed files

  • src/agents/openai-completions-compat.ts (modified, +2/-0)

Code Example

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"store\": Cannot find field.",
    "status": "INVALID_ARGUMENT"
  }
}

---

POST /chat/completions
Authorization: Bearer <google-api-key>

{
  "model": "gemma-4-31b-it",
  "messages": [...],
  "tools": [...],
  "stream": true,
  "store": false,        // ← THIS CAUSES 400
  "max_completion_tokens": 32000
}

---

{
  "gemma-api": {
    "baseUrl": "https://generativelanguage.googleapis.com/v1beta/openai",
    "apiKey": "...",
    "api": "openai-completions",
    "authHeader": true,
    "models": [{
      "id": "gemma-4-31b-it",
      "name": "Gemma 4 31B",
      "reasoning": false
    }]
  }
}
RAW_BUFFERClick to expand / collapse

Problem

When using openai-completions API type with a non-OpenAI endpoint (e.g., Google's OpenAI-compatible endpoint at generativelanguage.googleapis.com/v1beta/openai), OpenClaw sends a store: false parameter in the request body.

This is added automatically by the OpenAI JS SDK (OpenAI/JS 6.26.0), but Google's OpenAI-compatible layer rejects unknown fields with a 400 error:

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"store\": Cannot find field.",
    "status": "INVALID_ARGUMENT"
  }
}

This prevents using Google's Gemma models (e.g., gemma-4-31b-it) via the OpenAI-compatible endpoint.

Full Request (captured via local proxy)

POST /chat/completions
Authorization: Bearer <google-api-key>

{
  "model": "gemma-4-31b-it",
  "messages": [...],
  "tools": [...],
  "stream": true,
  "store": false,        // ← THIS CAUSES 400
  "max_completion_tokens": 32000
}

Config

{
  "gemma-api": {
    "baseUrl": "https://generativelanguage.googleapis.com/v1beta/openai",
    "apiKey": "...",
    "api": "openai-completions",
    "authHeader": true,
    "models": [{
      "id": "gemma-4-31b-it",
      "name": "Gemma 4 31B",
      "reasoning": false
    }]
  }
}

Environment

  • OpenClaw 2026.4.2 (d74a122)
  • OpenAI JS SDK 6.26.0
  • macOS arm64, Node v25.8.0

Suggested Fix

Strip store (and other OpenAI-proprietary params) when baseUrl is not api.openai.com, or add a provider-level stripExtraParams option.

extent analysis

TL;DR

Remove the store parameter from the request body when using non-OpenAI endpoints to prevent 400 errors.

Guidance

  • Identify and remove any OpenAI-proprietary parameters (like store) from the request body when using the openai-completions API type with non-OpenAI endpoints.
  • Consider adding a provider-level stripExtraParams option to automatically remove unknown fields for specific endpoints.
  • Verify the request body sent to the endpoint to ensure it only includes supported parameters.
  • Test the API call with the modified request body to confirm the 400 error is resolved.

Example

No code snippet is provided as the issue is more related to configuration and parameter handling.

Notes

The OpenAI JS SDK automatically adds the store parameter, which is not compatible with Google's OpenAI-compatible endpoint. Removing this parameter or adding a mechanism to strip extra parameters can resolve the issue.

Recommendation

Apply a workaround by stripping the store parameter and other OpenAI-proprietary parameters when using non-OpenAI endpoints, as there is no clear indication of a fixed version that addresses this issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING