Skip to content

fix: resolve $ref and strip $defs/definitions/ref from tool schemas#10

Open
bulgadev wants to merge 2 commits into
Intelligent-Internet:mainfrom
bulgadev:fix/schema-ref
Open

fix: resolve $ref and strip $defs/definitions/ref from tool schemas#10
bulgadev wants to merge 2 commits into
Intelligent-Internet:mainfrom
bulgadev:fix/schema-ref

Conversation

@bulgadev

@bulgadev bulgadev commented May 9, 2026

Copy link
Copy Markdown

sanitizeGeminiSchema() only stripped $ref but left $defs/definitions intact, and never resolved $ref references inline. This caused the Gemini CodeAssist API to reject tool schemas with: 'Schema.ref was set alongside unsupported fields'.

Added resolveRef() to inline $ref/ref references from $defs/definitions before sanitization. Added ref, $defs, definitions to unsupported keys. Also handles exclusiveMinimum/exclusiveMaximum conversion.

@bulgadev bulgadev force-pushed the fix/schema-ref branch 2 times, most recently from 02505f1 to 15bdeaf Compare May 9, 2026 00:33
sanitizeGeminiSchema() only stripped $ref but left $defs/definitions
intact and never resolved $ref references inline. Added resolveRef()
to inline $ref/ref references before sanitization. Added ref, $defs,
definitions to unsupported keys.

Added this.config.setModel(model) in sendMessageStream() so the
model selected in OpenCode actually switches the Gemini model used.
Added gemini-3.1-pro-preview, gemini-3.1-flash-lite, gemini-3-pro-preview,
gemini-3-flash-preview to the /v1/models endpoint.
Clean modern README explaining the project, the $ref/defs fix,
model switching, OpenCode integration, and crediting original
fork and contributors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant