Skip to content

google-antigravity: cron tool schema rejected by Cloud Code Assist API #288

@HazAT

Description

@HazAT

Summary

When using google-antigravity provider (Cloud Code Assist), requests fail with a schema validation error for the cron tool (tool index #9).

Error Message

Cloud Code Assist API error (400): {
  "error": {
    "code": 400,
    "message": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"tools.9.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-schema.org/draft/2020-12). Learn more about tool use at https://docs.claude.com/en/docs/tool-use.\"},\"request_id\":\"req_vrtx_011CWqrgWryHbJJhnzxirXcr\"}",
    "status": "INVALID_ARGUMENT"
  }
}

Root Cause

The cron tool schema in src/agents/tools/cron-tool.ts has complex nested structures that pass Anthropic's direct API validation but fail Google Cloud Code Assist's stricter JSON Schema draft 2020-12 enforcement:

  1. Deeply nested anyOf unions - CronScheduleSchema, CronPayloadSchema, sessionTarget, wakeMode, channel all use TypeBox Type.Union() which compiles to anyOf
  2. Mixed additionalProperties - false inside nested objects but true at the root level
  3. minLength: 1 constraints on strings via NonEmptyString

The cleanSchemaForGemini() function in src/agents/pi-tools.ts attempts to normalize schemas but doesn't fully handle these nested union cases.

Workaround

Adding cron to the tool deny list allows google-antigravity to work:

{
  "agent": {
    "tools": {
      "deny": ["cron"]
    }
  }
}

Suggested Fix

Either:

  1. Simplify the CronToolSchema to avoid deeply nested unions (flatten to a single object with optional fields)
  2. Enhance cleanSchemaForGemini() to recursively simplify nested anyOf structures
  3. Add provider-specific schema transformations for google-antigravity

Environment

  • Clawdbot version: 2026.1.5-3
  • Provider: google-antigravity
  • Model: claude-opus-4-5-thinking

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