Bug type
Behavior bug (incorrect output/state without crash)
Summary
When using Google AI Studio (Gemini) via an OpenAI-compatible endpoint (like Cloudflare AI Gateway), OpenClaw throws 400 Bad Request or 401 Unauthorized errors.
After deep debugging via a local proxy, I found two distinct issues in OpenClaw 2026.3.2 during embedded agent runs:
- The
store parameter is still hardcoded: Even when explicitly configuring the model with "compat": { "supportsStore": false }, the embedded agent (agent/embedded) still injects "store": false into the JSON payload. This causes Gemini (and other strict compatible APIs) to reject the payload with a 400 error: Unknown name "store": Cannot find field.
- Custom
headers are dropped: When routing traffic through Cloudflare AI Gateway, custom headers defined in the provider config (e.g., "cf-aig-authorization": "...") are occasionally stripped or not passed through correctly by the underlying openai-completions client. This results in a 401 Unauthorized error from Cloudflare.
Steps to reproduce
- Configure an OpenAI-compatible provider pointing to Google AI Studio via Cloudflare AI Gateway.
- Add custom headers for Cloudflare auth (
cf-aig-authorization).
- Set
"compat": { "supportsStore": false } on the models.
- Run
openclaw agent --message "test".
- Observe the agent fail with either
400 status code (due to the store field) or 401 Unauthorized (due to missing headers).
Expected behavior
- The
compat.supportsStore: false setting should be strictly respected across all API calls (including embedded agent paths), completely omitting the store property from the payload.
- Custom
headers defined in the provider configuration should be reliably attached to every outbound HTTP request.
Actual behavior
Workaround Used
Currently, the only way to bypass this is by running a local Node.js proxy server that intercepts OpenClaw's requests, forcefully deletes store from the body, manually injects the missing cf-aig-authorization header, and then forwards the request to Cloudflare.
OpenClaw version
2026.3.2
Operating system
Linux
Install method
npm
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Bug type
Behavior bug (incorrect output/state without crash)
Summary
When using Google AI Studio (Gemini) via an OpenAI-compatible endpoint (like Cloudflare AI Gateway), OpenClaw throws
400 Bad Requestor401 Unauthorizederrors.After deep debugging via a local proxy, I found two distinct issues in OpenClaw
2026.3.2during embedded agent runs:storeparameter is still hardcoded: Even when explicitly configuring the model with"compat": { "supportsStore": false }, the embedded agent (agent/embedded) still injects"store": falseinto the JSON payload. This causes Gemini (and other strict compatible APIs) to reject the payload with a 400 error:Unknown name "store": Cannot find field.headersare dropped: When routing traffic through Cloudflare AI Gateway, custom headers defined in the provider config (e.g.,"cf-aig-authorization": "...") are occasionally stripped or not passed through correctly by the underlyingopenai-completionsclient. This results in a401 Unauthorizederror from Cloudflare.Steps to reproduce
cf-aig-authorization)."compat": { "supportsStore": false }on the models.openclaw agent --message "test".400 status code(due to thestorefield) or401 Unauthorized(due to missing headers).Expected behavior
compat.supportsStore: falsesetting should be strictly respected across all API calls (including embedded agent paths), completely omitting thestoreproperty from the payload.headersdefined in the provider configuration should be reliably attached to every outbound HTTP request.Actual behavior
Workaround Used
Currently, the only way to bypass this is by running a local Node.js proxy server that intercepts OpenClaw's requests, forcefully deletes
storefrom the body, manually injects the missingcf-aig-authorizationheader, and then forwards the request to Cloudflare.OpenClaw version
2026.3.2
Operating system
Linux
Install method
npm
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response