Skip to content

Conversation

@necaris
Copy link
Contributor

@necaris necaris commented Jul 18, 2025

This PR introduces a new function, sanitizeGeminiParameters, to recursively sanitize Zod schemas for tools being sent to Google's Gemini models. This is necessary to work around limitations in the Gemini API.

The implementation is a Zod-native equivalent of the logic found in the official Gemini CLI.

This will likely close #977 and #1052 and related issues.

This PR introduces a new function, `sanitizeGeminiParameters`, to
recursively sanitize Zod schemas for tools being sent to Google's
Gemini models. This is necessary to work around limitations in the
Gemini API.

The implementation is a Zod-native equivalent of the logic found in
the official Gemini CLI[1].

[1]: https://github.com/google-gemini/gemini-cli/blob/9dadf2295804867d44628eda32fc1e46d80f9db3/packages/core/src/tools/tool-registry.ts#L360

🤖 Generated with [opencode](https://opencode.ai)
@thdxr
Copy link
Contributor

thdxr commented Jul 18, 2025

nice ty!

@thdxr thdxr merged commit f1da70b into sst:dev Jul 18, 2025
nipuna-perera pushed a commit to nipuna-perera/opencode that referenced this pull request Jul 26, 2025
achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
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.

Unable to use Gemini 2.5 to continue an Anthropic session

2 participants