Skip to content

[Bug] Google OpenAI-compat fallback 400 from unsupported store + missing thought_signature during replay #53658

@s2030081

Description

@s2030081

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:

  1. top-level store: false is sent to Google OpenAI-compat and rejected as unknown field.
  2. 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

  1. Configure primary local model with Google fallback models.
  2. Force local timeout (e.g., low run timeout) to trigger fallback.
  3. Run embedded agent turn with tools enabled.
  4. 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

  1. Respect provider/model compatibility for store in all OpenAI-compat paths (not only selective API branches).
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions