Skip to content

[Bug] Gemini (jjcc/openai-compat) rejects cron tool schema: anyOf properties missing type field in v2026.6.1 #91542

Closed

Description

@qiukui666

Summary

After upgrading to v2026.6.1 (from v2026.5.27), all Gemini model requests via jjcc provider (OpenAI-compatible openai-completions API) fail with 400 Unable to submit request because functionDeclaration schema didn't specify the schema type field.

  • ✅ Works: stepfun/step-router-v1 (OpenAI-compat schema)
  • ❌ Broken: jjcc/gemini-3.1-pro-preview, jjcc/gemini-3.1-pro-preview-customtools

Root Cause

The cron tool schema uses anyOf for optional properties without an explicit type keyword at the property level:

{
  "sessionKey": {
    "anyOf": [
      { "type": "string" },
      { "type": "null" }
    ]
  }
}

jjcc's Gemini translation layer requires a type field on every property. The anyOf construct at the top level of a property definition (instead of inline type) causes Gemini to reject the entire request.

Error Logs (rotating among affected fields each request)

400: cron functionDeclaration `***.***.sessionKey` schema didn't specify the schema type field
400: cron functionDeclaration `***.***.agentId` schema didn't specify the schema type field
400: cron functionDeclaration `***.***.***.toolsAllow` schema didn't specify the schema type field
400: cron functionDeclaration `***.***.***.channel` schema didn't specify the schema type field

Note: each request hits a different affected field, suggesting jjcc's API iterates through and rejects on the first invalid one.

Affected Fields (all optional cron tool properties)

  • sessionKey
  • agentId
  • toolsAllow
  • channel (nested in delivery)

Workaround

Fall back to a non-Gemini provider (e.g., stepfun/step-router-v1).

Related

Environment

  • OpenClaw: v2026.6.1
  • Provider: jjcc (OpenAI-compat, api: openai-completions)
  • Model: gemini-3.1-pro-preview
  • Node.js: v24.15.0
  • OS: Linux 6.6.87 (WSL2)

Activity

  1. clawsweeper commented on Jun 9, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 3:42 PM ET / 19:42 UTC.

    Summary
    Keep open. Current main and the latest release still select Gemini schema cleanup from the provider id only, so jjcc with a Gemini model id can still miss the cleanup path; the open linked PR remains the focused fix candidate.

    Reproducibility: yes. source-reproducible: current main and v2026.6.9 leave jjcc with a Gemini model id outside the Gemini cleanup branch while cron schemas still contain nullable anyOf fields matching the reported errors. A live jjcc/Gemini request was not run in this read-only review.

    Root-cause cluster
    Relationship: canonical
    Canonical: #91542
    Summary: This issue is the canonical report for the jjcc/OpenAI-compatible Gemini cron schema rejection; the open focused PR is the current implementation candidate, while broader provider-projection PRs overlap but have not replaced it.

    Members:

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

    Next step
    No duplicate repair job is needed because #91559 is already open, mergeable, and focused on this issue.

    Review details

    Best possible solution:

    Review and land #91559, or an equivalent central normalizer fix, then close this issue after the fix reaches main.

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

    Yes, source-reproducible: current main and v2026.6.9 leave jjcc with a Gemini model id outside the Gemini cleanup branch while cron schemas still contain nullable anyOf fields matching the reported errors. A live jjcc/Gemini request was not run in this read-only review.

    Is this the best way to solve the issue?

    Yes, the linked central-normalizer fix is the best narrow shape because that layer already receives provider id, model id, and model compatibility. A cron-specific or jjcc-specific rewrite would duplicate provider-schema policy in the wrong place.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live jjcc/Gemini API request was run during this read-only review, so the external provider acceptance path remains source-reproducible rather than live-proven here.
    • The focused fix is open but not merged or released, so affected users on v2026.6.9 can still hit the reported provider-schema rejection.
    • Broader overlapping provider-schema projection PRs remain open, so maintainers should choose one canonical schema direction before landing duplicate fixes.

    Codex review notes: model internal, reasoning high; reviewed against 6daf9307e0b9.

    Label changes

    Label justifications:

    • P2: This is a normal-priority provider/model compatibility regression with a clear source path and limited Gemini-over-OpenAI-compatible blast radius.
    • impact:auth-provider: The reported failure blocks provider/model routing for Gemini models behind an OpenAI-compatible provider.
    Evidence reviewed

    What I checked:

    • Repository policy read: Root AGENTS.md and scoped agents AGENTS.md files were read; provider-facing tool schema behavior is compatibility-sensitive and the root policy specifically notes provider tool schemas should avoid anyOf where providers reject it. (AGENTS.md:14, 6daf9307e0b9)
    • Current main still misses Gemini model-id routing: normalizeToolParameterSchemaUncached normalizes modelProvider, then computes isGeminiProvider only from provider strings containing google or gemini; it does not consult modelId or modelCompat.toolSchemaProfile. (src/agents/agent-tools-parameter-schema.ts:771, 6daf9307e0b9)
    • Caller already has the missing context: The tool preparation path passes modelProvider, modelId, and modelCompat into normalizeToolParameters, so the central normalizer is the narrow repair boundary. (src/agents/agent-tools.ts:1212, 6daf9307e0b9)
    • Cron schema still contains reported nullable unions: Cron schema helpers build nullable string and string-array unions, and job/patch fields such as agentId, sessionKey, and toolsAllow use those helpers, matching the reported provider rejection paths when Gemini cleanup is not selected. (src/agents/tools/cron-tool.ts:82, 6daf9307e0b9)
    • Existing Gemini cleaner would remove the nullable shape: The Gemini cleaner strips null variants and simplifies single non-null nullable unions, which is the existing cleanup the linked fix routes to Gemini model ids behind OpenAI-compatible providers. (src/agents/schema/clean-for-gemini.ts:190, 6daf9307e0b9)
    • OpenAI-compatible transport forwards prepared parameters: The OpenAI Chat Completions adapter maps prepared tool parameters into function tool parameters, so provider-specific schema cleanup has to happen before this transport layer sends the request. (src/llm/providers/openai-completions.ts:1176, 6daf9307e0b9)

    Likely related people:

    • vincentkoc: Current-main blame in this checkout attributes the active normalizer and cron schema lines to recent Vincent Koc work, and live related PRs show overlapping provider-schema projection work in the same area. (role: recent area contributor; confidence: high; commits: 63fdc57b3ac2, e7e686db2d00, 9dd7f04b71e8; files: src/agents/agent-tools-parameter-schema.ts, src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.schema.test.ts)
    • steipete: History shows model compatibility and Gemini schema cleanup work in the provider-facing schema compatibility path used by this issue. (role: model/schema compatibility contributor; confidence: high; commits: b236f3910482, f43680873501, e569f15631c7; files: src/plugins/provider-model-compat.ts, src/agents/schema/clean-for-gemini.ts, src/agents/agent-tools-parameter-schema.ts)
    • brunolorente: Commit ca76e2fedc8e added typed cron job and patch schema properties, including the model-facing fields involved in the reported rejection path. (role: introduced related cron schema behavior; confidence: medium; commits: ca76e2fedc8e; files: src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.schema.test.ts)
    • openperf: Commit 8c1ca1f24517 removed OpenAPI 3.0-incompatible cron schema keywords for Gemini-backed validators in the same provider compatibility area. (role: adjacent Gemini schema contributor; confidence: medium; commits: 8c1ca1f24517; files: src/agents/schema/clean-for-gemini.ts, src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.schema.test.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    on Jun 9, 2026
  3. added
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    and removed
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jun 19, 2026
  4. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions