Skip to content

fix(agents): strip Gemini conditional schema keywords - #70497

Closed
junshanxu wants to merge 4 commits into
openclaw:mainfrom
junshanxu:codex/gemini-strip-conditional-schema-keywords
Closed

junshanxu wants to merge 4 commits into
openclaw:mainfrom
junshanxu:codex/gemini-strip-conditional-schema-keywords

Conversation

@junshanxu

Copy link
Copy Markdown
Contributor

Re-opening of PR #69964. The previous PR was automatically closed when the fork was made private.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Apr 23, 2026
@greptile-apps

greptile-apps Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds "if", "then", and "else" to GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS so those JSON Schema conditional keywords are stripped before sending tool schemas to the Gemini/Cloud Code Assist API, which rejects them with HTTP 400. The change is minimal, correctly wired into the existing keyword-stripping loop, and covered by a targeted regression test.

Confidence Score: 5/5

Safe to merge — the change is a one-liner addition to an existing Set and the new test covers the full if/then/else stripping scenario.

All findings are P2 or lower. The fix is minimal, correctly integrated into the existing stripping loop, and directly tested. No logic, security, or data-integrity concerns.

No files require special attention.

Reviews (1): Last reviewed commit: "ci: retrigger flaky extension checks" | Re-trigger Greptile

@prtags

prtags Bot commented Apr 23, 2026

Copy link
Copy Markdown

Related work from PRtags group worthy-mite-sck9

Title: agents: Gemini conditional schema keyword stripping

Number Title
#69964 fix(agents): strip Gemini conditional schema keywords
#70497* fix(agents): strip Gemini conditional schema keywords

* This PR

@clawsweeper

clawsweeper Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open because current main and the latest release still lack the conditional-keyword stripping, so the central bugfix remains useful. The branch is not merge-ready yet because it is conflicting, lacks real behavior proof, and carries unrelated pairing-store test churn.

Root-cause cluster
Relationship: canonical
Canonical: #70497
Summary: This PR remains the canonical open branch for Gemini conditional keyword stripping; the earlier same-author PR is closed unmerged, the linked user issue is closed stale, and the later merged Gemini cleanup PR only partially overlaps.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

No live high-confidence reproduction was established in this read-only review. We do have a clear source-level reproduction path: current main routes Gemini schemas through this cleaner, and the unsupported-keyword set does not strip if, then, or else.

Is this the best way to solve the issue?

Partly. Adding the keywords to the existing Gemini cleaner is the right owner boundary, but the current PR should be refreshed, narrowed to the schema fix, and backed by real behavior proof before merge.

Security review:

Security review cleared: No concrete security or supply-chain issue was found; the diff changes TypeScript schema-cleaning logic and tests only.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-23T05:54:42Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • openperf: Authored the merged cron/Gemini OpenAPI-subset fix that added not to this same unsupported-keyword cleaner after provider 400 failures. (role: adjacent Gemini schema contributor; confidence: high; commits: 8c1ca1f24517; files: src/agents/schema/clean-for-gemini.ts, src/agents/schema/clean-for-gemini.test.ts, src/agents/tools/cron-tool.ts)
  • xxxxxmax: Authored the merged required-field sanitizer for Gemini tool schema compatibility in the same cleaner. (role: same-area bugfix author; confidence: high; commits: 0dbcf81b343c; files: src/agents/schema/clean-for-gemini.ts, src/agents/schema/clean-for-gemini.test.ts)
  • steipete: Committed the required-field sanitizer and authored earlier provider-specific tool policy work that shaped this schema normalization boundary. (role: feature-history contributor and committer; confidence: high; commits: fe1fd055d557, fa8d9b91892f; files: src/agents/schema/clean-for-gemini.ts, src/agents/agent-tools-parameter-schema.ts)
  • Pick-cat: Authored the merged Gemini model-id cleanup that shares this provider schema normalization path but does not cover conditional keywords. (role: recent adjacent contributor; confidence: medium; commits: 1f89d6d7f762; files: src/agents/agent-tools-parameter-schema.ts, src/agents/agent-tools.schema.test.ts, src/agents/tools/cron-tool.schema.test.ts)
  • vincentkoc: Recent history shows provider replay and tool compatibility helper work around the same model-compat and schema-normalization surface. (role: recent provider compatibility contributor; confidence: medium; commits: 858bf405f411; files: src/agents/agent-tools-parameter-schema.ts, src/plugin-sdk/provider-tools.ts)

Codex review notes: model internal, reasoning high; reviewed against 4fc504d321b6.

@junshanxu
junshanxu force-pushed the codex/gemini-strip-conditional-schema-keywords branch from 07821fe to 49d6806 Compare April 29, 2026 05:47
@junshanxu
junshanxu force-pushed the codex/gemini-strip-conditional-schema-keywords branch from 49d6806 to 39c98f1 Compare April 29, 2026 06:13
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 7, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 13, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 13, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant