Skip to content

fix: preserve 'pattern' in antigravity tool schema translation (#1368)#1896

Open
mustafabozkaya wants to merge 4 commits into
decolua:masterfrom
mustafabozkaya:fix/antigravity-pattern-stripping
Open

fix: preserve 'pattern' in antigravity tool schema translation (#1368)#1896
mustafabozkaya wants to merge 4 commits into
decolua:masterfrom
mustafabozkaya:fix/antigravity-pattern-stripping

Conversation

@mustafabozkaya

Copy link
Copy Markdown
Contributor

This PR fixes a bug where the pattern property and its required constraint were being stripped from glob and grep tool schemas when using the antigravity provider.

Problem

The cleanJSONSchemaForAntigravity function in geminiHelper.js was using a list of unsupported keywords that included pattern. This caused the property to be removed from the translated schema, leading to errors when models tried to call these tools without the required pattern argument.

Solution

  • Removed "pattern" from the UNSUPPORTED_SCHEMA_CONSTRAINTS array in open-sse/translator/helpers/geminiHelper.js.
  • Added a new unit test in tests/unit/gemini-helper-schema.test.js to verify that pattern and required are correctly preserved.

This fix ensures that tool schemas are correctly translated for the antigravity provider without losing essential properties.

Fixes #1368

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.

[bug] [provider:antigravity] glob/grep schemas lose required 'pattern' parameter in translation

1 participant