openclaw - ✅(Solved) Fix Cerebras: 400 error caused by unsupported 'store' parameter (compat.supportsStore ignored) [2 pull requests, 2 comments, 3 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#51058Fetched 2026-04-08 01:04:49
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
referenced ×3commented ×2cross-referenced ×2

When using Cerebras provider (cerebras/llama3.1-8b, cerebras/gpt-oss-120b, etc.), every request fails with 400 status code (no body). The actual error from Cerebras API is:

{"message":"body.store: property 'body.store' is unsupported","type":"invalid_request_error","param":"validation_error","code":"wrong_api_format"}

Error Message

When using Cerebras provider (cerebras/llama3.1-8b, cerebras/gpt-oss-120b, etc.), every request fails with 400 status code (no body). The actual error from Cerebras API is: 4. Observe error: 400 status code (no body)

Root Cause

OpenClaw sends store: false in the request body for OpenAI-compatible APIs. Cerebras API does not support the store parameter and returns HTTP 400.

The compat.supportsStore: false setting in models.json is ignored for the built-in Cerebras provider.

Fix Action

Fix / Workaround

Workaround Attempted

  • #22704 - Similar issue with Google AI Studio (fixed by adding provider to isNonStandard list)

PR fix notes

PR #51107: fix(providers): strip store param for non-Responses APIs when supportsStore=false

Description (problem / solution / changelog)

Summary

Remove the OPENAI_RESPONSES_APIS guard from shouldStripResponsesStore so the store parameter is stripped for any model that declares compat.supportsStore: false, regardless of API type.

Why this matters

  • Issue #51058: Cerebras provider returns HTTP 400 on every request because OpenClaw sends store: false in the request body - Cerebras API does not support the store parameter
  • The compat.supportsStore: false model config is supposed to prevent this, but shouldStripResponsesStore at src/agents/pi-embedded-runner/openai-stream-wrappers.ts:144-155 only checks for openai-responses API
  • Cerebras uses openai-completions API, so the strip never fires
  • The upstream pi-ai library hardcodes store: false (noted at src/agents/pi-embedded-runner/extra-params.ts:290)

Changes

  • shouldStripResponsesStore: removed the typeof model.api and OPENAI_RESPONSES_APIS.has(model.api) checks. Now strips store whenever compat.supportsStore === false and forceStore is not active
  • Added test for openai-completions API path with supportsStore=false (Cerebras model config)
  • All 4 existing supportsStore tests continue to pass

Testing

  • pnpm test -- src/agents/pi-embedded-runner-extraparams.test.ts -t supportsStore - 4/4 pass
  • New test: "strips store from payload for openai-completions providers with supportsStore=false (#51058)"

This contribution was developed with AI assistance (Claude Code).

Fixes #51058

Changed files

  • src/agents/pi-embedded-runner-extraparams.test.ts (modified, +21/-0)
  • src/agents/pi-embedded-runner/openai-stream-wrappers.ts (modified, +3/-4)

PR #51236: fix(providers): only send store param when supportsStore is true

Description (problem / solution / changelog)

Summary

  • The condition supportsStore !== false incorrectly sent the store parameter when supportsStore was undefined (e.g. Cerebras), causing 400 errors from providers that reject unknown fields
  • Changed to supportsStore === true so store is only included when explicitly opted in

Change Type

  • Bug fix

Linked Issue

  • Closes #51058

Changed files

  • src/agents/openai-ws-stream.ts (modified, +1/-1)

Code Example

{"message":"body.store: property 'body.store' is unsupported","type":"invalid_request_error","param":"validation_error","code":"wrong_api_format"}

---

curl -s "https://api.cerebras.ai/v1/chat/completions" \
  -H "Authorization: Bearer $CEREBRAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.1-8b", "messages": [{"role": "user", "content": "hi"}]}'
# Returns valid response

---

curl -s "https://api.cerebras.ai/v1/chat/completions" \
  -H "Authorization: Bearer $CEREBRAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.1-8b", "messages": [{"role": "user", "content": "hi"}], "store": false}'
# Returns: {"message":"body.store: property 'body.store' is unsupported"}

---

{
  "id": "llama3.1-8b",
  "name": "Llama 3.1 8B (Cerebras)",
  "compat": {
    "supportsStore": false
  }
}

---

const isNonStandard =
  // ... existing checks ...
  provider === "cerebras" ||
  baseUrl.includes("cerebras.ai");
RAW_BUFFERClick to expand / collapse

Summary

When using Cerebras provider (cerebras/llama3.1-8b, cerebras/gpt-oss-120b, etc.), every request fails with 400 status code (no body). The actual error from Cerebras API is:

{"message":"body.store: property 'body.store' is unsupported","type":"invalid_request_error","param":"validation_error","code":"wrong_api_format"}

Root Cause

OpenClaw sends store: false in the request body for OpenAI-compatible APIs. Cerebras API does not support the store parameter and returns HTTP 400.

The compat.supportsStore: false setting in models.json is ignored for the built-in Cerebras provider.

Expected Behavior

When compat.supportsStore: false is set, OpenClaw should not send the store parameter in the request body.

Actual Behavior

OpenClaw sends store: false regardless of the compat.supportsStore: false setting.

Reproduction

  1. Configure Cerebras API key: export CEREBRAS_API_KEY=...
  2. Set model: openclaw models set cerebras/llama3.1-8b
  3. Send any message
  4. Observe error: 400 status code (no body)

Direct curl test (without store - works):

curl -s "https://api.cerebras.ai/v1/chat/completions" \
  -H "Authorization: Bearer $CEREBRAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.1-8b", "messages": [{"role": "user", "content": "hi"}]}'
# Returns valid response

Direct curl test (with store - fails):

curl -s "https://api.cerebras.ai/v1/chat/completions" \
  -H "Authorization: Bearer $CEREBRAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.1-8b", "messages": [{"role": "user", "content": "hi"}], "store": false}'
# Returns: {"message":"body.store: property 'body.store' is unsupported"}

Workaround Attempted

Added compat.supportsStore: false to all Cerebras models in models.json:

{
  "id": "llama3.1-8b",
  "name": "Llama 3.1 8B (Cerebras)",
  "compat": {
    "supportsStore": false
  }
}

Result: Did not fix the issue. The store parameter is still being sent.

Related Issues

  • #22704 - Similar issue with Google AI Studio (fixed by adding provider to isNonStandard list)

Suggested Fix

Similar to the fix for Google AI Studio (#22704), add Cerebras to the list of non-standard providers that should not receive the store parameter:

const isNonStandard =
  // ... existing checks ...
  provider === "cerebras" ||
  baseUrl.includes("cerebras.ai");

Or ensure that compat.supportsStore: false is properly respected for built-in providers.

Environment

  • OpenClaw version: 2026.3.13 (61d171a)
  • Provider: cerebras
  • Models tested: llama3.1-8b, gpt-oss-120b, qwen-3-235b-a22b-instruct-2507, zai-glm-4.7
  • Node.js: v22.22.0
  • OS: Linux 6.8.0-101-generic (x64)

extent analysis

Fix Plan

To resolve the issue, you need to modify the OpenClaw code to either add Cerebras to the list of non-standard providers or ensure that compat.supportsStore: false is respected for built-in providers. Here are the steps:

  • Modify the isNonStandard check to include Cerebras:
const isNonStandard =
  // ... existing checks ...
  provider === "cerebras" ||
  baseUrl.includes("cerebras.ai");

Alternatively, you can update the code to respect compat.supportsStore: false for built-in providers:

if (provider === "cerebras" && compat.supportsStore === false) {
  delete requestBody.store;
}
  • Apply the changes to the OpenClaw codebase and rebuild the project.

Verification

To verify that the fix worked, follow these steps:

  1. Configure the Cerebras API key: export CEREBRAS_API_KEY=...
  2. Set the model: openclaw models set cerebras/llama3.1-8b
  3. Send a message and observe the response.
  4. The response should no longer return a 400 status code (no body) error.

Extra Tips

  • Make sure to test the fix with different Cerebras models to ensure that the issue is resolved across all models.
  • If you're using a version control system, create a new branch for the fix and merge it into the main branch after verification.
  • Consider adding automated tests to prevent similar issues in the future.

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

openclaw - ✅(Solved) Fix Cerebras: 400 error caused by unsupported 'store' parameter (compat.supportsStore ignored) [2 pull requests, 2 comments, 3 participants]