Summary
Embedded fallback to Google OpenAI-compatible endpoint fails with 400 status code (no body) in OpenClaw agent runs.
I traced this to two payload-compatibility problems during fallback/replay:
- top-level
store: false is sent to Google OpenAI-compat and rejected as unknown field.
- replayed tool/function call history can hit Gemini validation errors: missing
thought_signature in functionCall parts.
Environment
- OpenClaw: 2026.3.23-2
- API mode:
openai-completions
- Provider: Google OpenAI-compatible endpoint (
https://generativelanguage.googleapis.com/v1beta/openai/)
- Model chain tested: local/qwen-3.5-35b-a3b -> google/gemini-3-flash-preview -> google/gemini-3.1-pro-preview
- OS: Linux (Docker)
Reproduction
- Configure primary local model with Google fallback models.
- Force local timeout (e.g., low run timeout) to trigger fallback.
- Run embedded agent turn with tools enabled.
- Observe fallback fail with 400.
Evidence
- Captured fallback request includes top-level keys like:
model
messages
tools
stream
max_completion_tokens
store (false)
- Direct Google compat test confirms unknown
store field returns 400 INVALID_ARGUMENT.
- After stripping
store, upstream can still return 400 on replay turns with:
Function call is missing a thought_signature in functionCall parts ... default_api:read ...
Expected Behavior
Fallback requests to Google OpenAI-compat should avoid unsupported fields and replay history in a way that does not violate thought_signature requirements.
Actual Behavior
Fallback/replay may fail with HTTP 400, then compaction safeguard triggers, and embedded run ends with an error payload.
Suggested Fix
- Respect provider/model compatibility for
store in all OpenAI-compat paths (not only selective API branches).
- In fallback/replay for Gemini tool loops, preserve required thought_signature metadata OR avoid replaying function/tool-call parts that cannot be validated by target endpoint.
- Add regression tests for:
- Google OpenAI-compat + store unsupported
- fallback replay with tool-call history requiring thought_signature
Notes
This may be related to prior issues around store compatibility and Gemini thought_signature handling, but this report is for Google OpenAI-compat fallback path in embedded agent runs.
Summary
Embedded fallback to Google OpenAI-compatible endpoint fails with
400 status code (no body)in OpenClaw agent runs.I traced this to two payload-compatibility problems during fallback/replay:
store: falseis sent to Google OpenAI-compat and rejected as unknown field.thought_signaturein functionCall parts.Environment
openai-completionshttps://generativelanguage.googleapis.com/v1beta/openai/)Reproduction
Evidence
modelmessagestoolsstreammax_completion_tokensstore(false)storefield returns 400 INVALID_ARGUMENT.store, upstream can still return 400 on replay turns with:Function call is missing a thought_signature in functionCall parts ... default_api:read ...Expected Behavior
Fallback requests to Google OpenAI-compat should avoid unsupported fields and replay history in a way that does not violate thought_signature requirements.
Actual Behavior
Fallback/replay may fail with HTTP 400, then compaction safeguard triggers, and embedded run ends with an error payload.
Suggested Fix
storein all OpenAI-compat paths (not only selective API branches).Notes
This may be related to prior issues around
storecompatibility and Gemini thought_signature handling, but this report is for Google OpenAI-compat fallback path in embedded agent runs.