test: update union type test to verify parametersJsonSchema passthrough instead of Gemini Schema conversion - #3520
Conversation
📝 WalkthroughWalkthroughThis PR updates Gemini tool conversion tests to validate union-typed parameters through wire JSON Schema format. The primary test now asserts that ChangesGemini Union Type Parameter Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
parametersJsonSchema passthrough instead of Gemini Schema conversion
Confidence Score: 3/5The production implementation is not changed, but three sub-tests in WirePayload assert wire-format expectations that directly contradict the passthrough behavior now verified by UnionTypeProperty — merging will result in test failures. The TestConvertBifrostToolsToGemini_WirePayload cases for union types were not updated to reflect the move from Gemini-schema conversion to raw JSON passthrough. Their wantContains strings will not appear in the wire when ParametersJSONSchema holds the raw array, and the wantAbsent strings will actually be present, causing assertion failures. core/providers/gemini/uniontype_test.go — specifically the wantContains/wantAbsent slices for the three union-type cases in TestConvertBifrostToolsToGemini_WirePayload. Important Files Changed
|
Merge activity
|
…ough instead of Gemini Schema conversion (#3520) ## Summary Updates the Gemini tool conversion tests to reflect the shift from converting JSON Schema union types into Gemini-native `Schema` objects to passing them through unchanged via `parametersJsonSchema`. This aligns the tests with the current behavior where tool parameters with union types (e.g., `["integer", "null"]`) are preserved as raw JSON Schema rather than being transformed into Gemini's `Type`/`Nullable` representation. ## Changes - Updated `TestConvertBifrostToolsToGemini_UnionTypeProperty` to assert that `fd.ParametersJSONSchema` is populated and `fd.Parameters` is nil, reflecting the passthrough approach. - Replaced assertions checking for Gemini-native `Type` and `Nullable` fields with assertions that verify the original JSON Schema union array (`["integer", "null"]`) is preserved intact. - Updated `TestConvertBifrostToolsToGemini_WirePayload` to handle the new `(tools, error)` return signature of `convertBifrostToolsToGemini`. - Updated the test comment to accurately describe the current behavior rather than referencing the previous Goose+Vertex bug fix. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./core/providers/gemini/... ``` Expected: all tests pass, including `TestConvertBifrostToolsToGemini_UnionTypeProperty` and `TestConvertBifrostToolsToGemini_WirePayload`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [ ] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…ough instead of Gemini Schema conversion (#3520) ## Summary Updates the Gemini tool conversion tests to reflect the shift from converting JSON Schema union types into Gemini-native `Schema` objects to passing them through unchanged via `parametersJsonSchema`. This aligns the tests with the current behavior where tool parameters with union types (e.g., `["integer", "null"]`) are preserved as raw JSON Schema rather than being transformed into Gemini's `Type`/`Nullable` representation. ## Changes - Updated `TestConvertBifrostToolsToGemini_UnionTypeProperty` to assert that `fd.ParametersJSONSchema` is populated and `fd.Parameters` is nil, reflecting the passthrough approach. - Replaced assertions checking for Gemini-native `Type` and `Nullable` fields with assertions that verify the original JSON Schema union array (`["integer", "null"]`) is preserved intact. - Updated `TestConvertBifrostToolsToGemini_WirePayload` to handle the new `(tools, error)` return signature of `convertBifrostToolsToGemini`. - Updated the test comment to accurately describe the current behavior rather than referencing the previous Goose+Vertex bug fix. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./core/providers/gemini/... ``` Expected: all tests pass, including `TestConvertBifrostToolsToGemini_UnionTypeProperty` and `TestConvertBifrostToolsToGemini_WirePayload`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [ ] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…ough instead of Gemini Schema conversion (maximhq#3520) ## Summary Updates the Gemini tool conversion tests to reflect the shift from converting JSON Schema union types into Gemini-native `Schema` objects to passing them through unchanged via `parametersJsonSchema`. This aligns the tests with the current behavior where tool parameters with union types (e.g., `["integer", "null"]`) are preserved as raw JSON Schema rather than being transformed into Gemini's `Type`/`Nullable` representation. ## Changes - Updated `TestConvertBifrostToolsToGemini_UnionTypeProperty` to assert that `fd.ParametersJSONSchema` is populated and `fd.Parameters` is nil, reflecting the passthrough approach. - Replaced assertions checking for Gemini-native `Type` and `Nullable` fields with assertions that verify the original JSON Schema union array (`["integer", "null"]`) is preserved intact. - Updated `TestConvertBifrostToolsToGemini_WirePayload` to handle the new `(tools, error)` return signature of `convertBifrostToolsToGemini`. - Updated the test comment to accurately describe the current behavior rather than referencing the previous Goose+Vertex bug fix. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./core/providers/gemini/... ``` Expected: all tests pass, including `TestConvertBifrostToolsToGemini_UnionTypeProperty` and `TestConvertBifrostToolsToGemini_WirePayload`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [ ] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…ough instead of Gemini Schema conversion (maximhq#3520) ## Summary Updates the Gemini tool conversion tests to reflect the shift from converting JSON Schema union types into Gemini-native `Schema` objects to passing them through unchanged via `parametersJsonSchema`. This aligns the tests with the current behavior where tool parameters with union types (e.g., `["integer", "null"]`) are preserved as raw JSON Schema rather than being transformed into Gemini's `Type`/`Nullable` representation. ## Changes - Updated `TestConvertBifrostToolsToGemini_UnionTypeProperty` to assert that `fd.ParametersJSONSchema` is populated and `fd.Parameters` is nil, reflecting the passthrough approach. - Replaced assertions checking for Gemini-native `Type` and `Nullable` fields with assertions that verify the original JSON Schema union array (`["integer", "null"]`) is preserved intact. - Updated `TestConvertBifrostToolsToGemini_WirePayload` to handle the new `(tools, error)` return signature of `convertBifrostToolsToGemini`. - Updated the test comment to accurately describe the current behavior rather than referencing the previous Goose+Vertex bug fix. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./core/providers/gemini/... ``` Expected: all tests pass, including `TestConvertBifrostToolsToGemini_UnionTypeProperty` and `TestConvertBifrostToolsToGemini_WirePayload`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [ ] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Updates the Gemini tool conversion tests to reflect the shift from converting JSON Schema union types into Gemini-native
Schemaobjects to passing them through unchanged viaparametersJsonSchema. This aligns the tests with the current behavior where tool parameters with union types (e.g.,["integer", "null"]) are preserved as raw JSON Schema rather than being transformed into Gemini'sType/Nullablerepresentation.Changes
TestConvertBifrostToolsToGemini_UnionTypePropertyto assert thatfd.ParametersJSONSchemais populated andfd.Parametersis nil, reflecting the passthrough approach.TypeandNullablefields with assertions that verify the original JSON Schema union array (["integer", "null"]) is preserved intact.TestConvertBifrostToolsToGemini_WirePayloadto handle the new(tools, error)return signature ofconvertBifrostToolsToGemini.Type of change
Affected areas
How to test
go test ./core/providers/gemini/...Expected: all tests pass, including
TestConvertBifrostToolsToGemini_UnionTypePropertyandTestConvertBifrostToolsToGemini_WirePayload.Breaking changes
Related issues
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines