openclaw - ✅(Solved) Fix gemini-2.5-flash rejects cron tool payloads with HTTP 400 no-body since ~2026-04-15 [1 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#69768Fetched 2026-04-22 07:48:30
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×1

Error Message

User-facing error surfaced to the delivery channel: error=LLM request failed: provider rejected the request schema or tool payload. payloads=0 — surfacing error to user Per PR #68238 in 2026.4.15, Google 400s are explicitly excluded from the retryable-error set ("only treat INTERNAL status payloads as retryable timeouts when they also carry a 500 code"). This means agents.defaults.model.fallbacks does not fire for this failure class — the cron dies rather than failing over. 3. cron.failureDestination is documented but was not visible from the incident-investigation path. Would you consider a release-note-level callout that native per-job status=error rows have a native notification mechanism, since the default behavior is "the error text gets delivered as the cron output" which silently masks failures? The failure was invisible for 6 business days in our deployment because the error text itself was delivered as the cron's output (deliveryStatus=delivered), so our health-check tooling (which only watches undelivered runs) did not flag it. Setting cron.failureDestination addressed the visibility half — suggest this become a recommended default for any production OpenClaw deployment.

Root Cause

Additional context

The failure was invisible for 6 business days in our deployment because the error text itself was delivered as the cron's output (deliveryStatus=delivered), so our health-check tooling (which only watches undelivered runs) did not flag it. Setting cron.failureDestination addressed the visibility half — suggest this become a recommended default for any production OpenClaw deployment.

PR fix notes

PR #69964: fix(agents): strip Gemini conditional schema keywords

Description (problem / solution / changelog)

Summary

  • Strip JSON Schema conditional keywords if, then, and else from Gemini tool schemas.
  • Add a regression test that keeps regular properties while removing conditionals.

Closes #69768

Tests

  • node scripts/test-projects.mjs src/agents/schema/clean-for-gemini.test.ts
  • node scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.core.json src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.ts
  • pnpm exec oxfmt --check src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.ts
  • git diff --check -- src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.ts

Changed files

  • src/agents/schema/clean-for-gemini.test.ts (modified, +29/-0)
  • src/agents/schema/clean-for-gemini.ts (modified, +4/-1)

Code Example

⚠️ Agent couldn't generate a response. Please try again.

---

[agent/embedded] embedded run agent end: isError=true
  model=gemini-2.5-flash provider=google
  error=LLM request failed: provider rejected the request schema or tool payload.
  rawError=400 status code (no body)
[agent/embedded] incomplete turn detected: ... stopReason=undefined
  payloads=0 — surfacing error to user
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw 2026.4.15 (041266a)
  • Runtime: bare-metal on Linux, gateway + scheduled cron jobs

Symptom

Scheduled cron jobs configured with model google/gemini-2.5-flash (alias flash) for tool-calling workloads began failing at a 20–50% per-job rate starting approximately 2026-04-15.

User-facing error surfaced to the delivery channel:

⚠️ Agent couldn't generate a response. Please try again.

Gateway log signature

[agent/embedded] embedded run agent end: isError=true
  model=gemini-2.5-flash provider=google
  error=LLM request failed: provider rejected the request schema or tool payload.
  rawError=400 status code (no body)
[agent/embedded] incomplete turn detected: ... stopReason=undefined
  payloads=0 — surfacing error to user

Scope

9 distinct cron jobs affected across multiple agents. The busiest (running every 15 min during weekday business hours) reached 37 consecutive errors before manual remediation. All failures have identical signature — the provider returns HTTP 400 with no response body on tool-heavy payloads, pure-text cron payloads on Flash are unaffected.

Native failover does not apply

Per PR #68238 in 2026.4.15, Google 400s are explicitly excluded from the retryable-error set ("only treat INTERNAL status payloads as retryable timeouts when they also carry a 500 code"). This means agents.defaults.model.fallbacks does not fire for this failure class — the cron dies rather than failing over.

Reproduction

Any cron job with payload.model = google/gemini-2.5-flash that uses multiple tool schemas in a single turn. The failure rate scales with payload complexity, not request volume.

Remediation applied locally

Switched affected cron jobs to openai/gpt-4.1-mini via openclaw cron edit <id> --model openai/gpt-4.1-mini. All runs since the change have succeeded.

Questions to maintainers

  1. Is this a known Google API-side tool-schema-validator tightening, or is OpenClaw's tool payload serialization the variable? The symptom cut-in coincides with the 2026.4.15 release window but also with broader Google API updates.
  2. Would you accept a docs PR adding "avoid Gemini Flash for tool-heavy cron workloads" guidance to docs/cli/cron.md and/or docs/concepts/models.md?
  3. cron.failureDestination is documented but was not visible from the incident-investigation path. Would you consider a release-note-level callout that native per-job status=error rows have a native notification mechanism, since the default behavior is "the error text gets delivered as the cron output" which silently masks failures?

Additional context

The failure was invisible for 6 business days in our deployment because the error text itself was delivered as the cron's output (deliveryStatus=delivered), so our health-check tooling (which only watches undelivered runs) did not flag it. Setting cron.failureDestination addressed the visibility half — suggest this become a recommended default for any production OpenClaw deployment.

extent analysis

TL;DR

Switching to a different model, such as openai/gpt-4.1-mini, may resolve the issue with cron jobs failing due to Google API request schema or tool payload rejections.

Guidance

  • The issue seems to be related to the google/gemini-2.5-flash model and its compatibility with tool-heavy payloads, so trying a different model is a viable workaround.
  • To verify if the issue is specific to the google/gemini-2.5-flash model, test the same cron job with a different model and check if the error persists.
  • Consider adding documentation to warn users about potential issues with using google/gemini-2.5-flash for tool-heavy cron workloads.
  • Setting cron.failureDestination can help improve visibility into cron job failures, which can aid in debugging and incident response.

Notes

The root cause of the issue is unclear, and it may be related to changes in the Google API or OpenClaw's tool payload serialization. Further investigation is needed to determine the exact cause.

Recommendation

Apply workaround: Switch to a different model, such as openai/gpt-4.1-mini, for cron jobs that are experiencing failures with the google/gemini-2.5-flash model. This is because the issue seems to be specific to this model and switching to a different model has already shown to resolve the issue in the reported case.

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