mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:28:29 +00:00
fix: strip unsupported JSON Schema keywords for Claude via Cloud Code Assist (openclaw#20124) thanks @ephraimm
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check (fails on existing unrelated type error: src/agents/subagent-announce.format.e2e.test.ts:71) - pnpm test:e2e src/agents/pi-embedded-runner/google.e2e.test.ts - pnpm test:macmini (fails on existing unrelated test: src/agents/subagent-registry.steer-restart.test.ts) Co-authored-by: ephraimm <2803669+ephraimm@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -247,11 +247,11 @@ export function sanitizeToolsForGoogle<
|
||||
tools: AgentTool<TSchemaType, TResult>[];
|
||||
provider: string;
|
||||
}): AgentTool<TSchemaType, TResult>[] {
|
||||
// google-antigravity serves Anthropic models (e.g. claude-opus-4-6-thinking),
|
||||
// NOT Gemini. Applying Gemini schema cleaning strips JSON Schema keywords
|
||||
// (minimum, maximum, format, etc.) that Anthropic's API requires for
|
||||
// draft 2020-12 compliance. Only clean for actual Gemini providers.
|
||||
if (params.provider !== "google-gemini-cli") {
|
||||
// Cloud Code Assist uses the OpenAPI 3.03 `parameters` field for both Gemini
|
||||
// AND Claude models. This field does not support JSON Schema keywords such as
|
||||
// patternProperties, additionalProperties, $ref, etc. We must clean schemas
|
||||
// for every provider that routes through this path.
|
||||
if (params.provider !== "google-gemini-cli" && params.provider !== "google-antigravity") {
|
||||
return params.tools;
|
||||
}
|
||||
return params.tools.map((tool) => {
|
||||
|
||||
Reference in New Issue
Block a user