fix(agents): apply Gemini schema cleaning for Gemini models via OpenAI-compat providers#91714
fix(agents): apply Gemini schema cleaning for Gemini models via OpenAI-compat providers#91714dwc1997 wants to merge 3 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. This PR is a focused attempt at the linked Gemini-over-OpenAI-compatible schema bug, but it is superseded by a viable open PR that covers the same central fix and preserves the adjacent model-compat contracts this branch misses. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this branch as superseded and use #91559 as the canonical provider-normalizer fix path for the linked bug. So I’m closing this here and keeping the remaining discussion on #91559. Review detailsBest possible solution: Close this branch as superseded and use #91559 as the canonical provider-normalizer fix path for the linked bug. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main passes modelId into tool normalization but only selects Gemini cleanup from provider id, while cron nullable union fields match the linked issue's rejected schema paths. I did not run a live jjcc/Gemini endpoint request in this read-only review. Is this the best way to solve the issue? No, this branch is no longer the best merge shape. The canonical PR fixes the same central normalizer path and also preserves toolSchemaProfile/cache behavior plus explicit unsupported-keyword stripping after Gemini cleanup. Security review: Security review cleared: The diff changes TypeScript schema-normalization logic and colocated tests only; it does not touch dependencies, lockfiles, workflows, credentials, downloads, or package execution surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 0a3e0d081dc4. |
…tion (openclaw#91714) Add focused regression tests for non-Google providers with Gemini model IDs: - Verifies unsupported keywords (minLength, maxLength, etc.) are stripped - Verifies required fields are sanitized against merged properties - Confirms non-Gemini model IDs do NOT trigger Gemini cleaning Add proof-91714.mjs that runs normalizeToolParameters with a non-Google provider (jjcc) and Gemini model ID, demonstrating the fix works end-to-end. Co-Authored-By: Claude <[email protected]>
|
@clawsweeper re-review Added regression tests and real behavior proof:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…tion (openclaw#91714) Add focused regression tests for non-Google providers with Gemini model IDs: - Verifies unsupported keywords (minLength, maxLength, etc.) are stripped - Verifies required fields are sanitized against merged properties - Confirms non-Gemini model IDs do NOT trigger Gemini cleaning Add proof-91714.mjs that runs normalizeToolParameters with a non-Google provider (jjcc) and Gemini model ID, demonstrating the fix works end-to-end. Co-Authored-By: Claude <[email protected]>
b3b9bd7 to
848e90c
Compare
…tion (openclaw#91714) Add focused regression tests for non-Google providers with Gemini model IDs: - Verifies unsupported keywords (minLength, maxLength, etc.) are stripped - Verifies required fields are sanitized against merged properties - Confirms non-Gemini model IDs do NOT trigger Gemini cleaning Add proof-91714.mjs that runs normalizeToolParameters with a non-Google provider (jjcc) and Gemini model ID, demonstrating the fix works end-to-end. Co-Authored-By: Claude <[email protected]>
848e90c to
22d4fc3
Compare
…I-compat providers Previously, isGeminiProvider only checked if the provider name contained "google" or "gemini". This missed OpenAI-compatible providers (like jjcc) that route to Gemini models, causing cron tool schema with anyOf to be rejected by Gemini's stricter validation. This fix adds model ID checking so Gemini schema cleaning is applied when the model ID contains "gemini", regardless of the provider name. Closes openclaw#91542 Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tion (openclaw#91714) Add focused regression tests for non-Google providers with Gemini model IDs: - Verifies unsupported keywords (minLength, maxLength, etc.) are stripped - Verifies required fields are sanitized against merged properties - Confirms non-Gemini model IDs do NOT trigger Gemini cleaning Add proof-91714.mjs that runs normalizeToolParameters with a non-Google provider (jjcc) and Gemini model ID, demonstrating the fix works end-to-end. Co-Authored-By: Claude <[email protected]>
The proof-91714.mjs file at the repo root is flagged by check-duplicates.mjs as a tracked file outside scan targets. The proof output is now fully embedded in the PR body.
22d4fc3 to
af889e8
Compare
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Problem:
isGeminiProvideronly checked if the provider name contained "google" or "gemini". This missed OpenAI-compatible providers (like jjcc) that route to Gemini models, causing cron tool schema withanyOfto be rejected by Gemini's stricter validation.Fix: Add model ID checking so Gemini schema cleaning is applied when the model ID contains "gemini", regardless of the provider name.
Linked context
Closes #91542
Real behavior proof
isGeminiProviderguard only checked the provider name for "google"/"gemini", so providers like "jjcc" that route to Gemini models were not recognized.node --import tsx/esm proof-91714.mjs(runsnormalizeToolParameterswith real OpenClaw code against a non-Google provider "jjcc" paired with model ID "gemini-2.0-flash")src/agents/agent-tools.schema.test.tsall pass (88/88 total).Tests and validation
agent-tools.schema.test.ts)normalizeToolParameterswith real OpenClaw code against actual schema inputsRisk checklist
Current review state