Repository navigation
fix(google): omit empty text from tool-only continuations - #1128
Merged
mikehostetler merged 2 commits intoOct 22, 2026
Merged
mikehostetler merged 2 commits into
mikehostetler merged 2 commits into
Conversation
Contributor
Author
|
Same as #1127 leaving this as draft since I want to respect your choice here |
gabrielrinaldi
marked this pull request as ready for review
October 22, 2026 14:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Shared OpenAI normalization converts an empty assistant content list to an empty string. The Google encoder then adds an empty text part before the function calls.
Skip that normalized empty content only for model messages with nonempty tool calls. Preserve call arguments, delivered call and thinking signatures, visible text, non-collapsed text parts, and ordinary empty messages. Shared defaults are unchanged. Gemini on Vertex AI uses the same converter.
This is independent of #1127: that PR preserves genuine text thought signatures; this fix avoids inventing text for a tool-only turn.
Type of Change
Breaking Changes
No public API changes. Tool-only Gemini requests no longer contain a synthesized empty text part.
Testing
mix test: 5311 passed, 11 skipped, 240 excluded. Default exclusions include coverage and integration.mix quality: formatting, warnings-as-errors compilation, strict Credo, and Dialyzer passed.Verified with Elixir 1.20.4 / OTP 29.1.2. No live inference or fixture recording.
Draft limitation
The Google compatibility-matrix failures documented in #1127 remain unresolved. They were not rerun merely to reconfirm them, and this PR does not claim that every failure is baseline-only or that the affected-provider gate passes. Existing fixtures are unchanged. This stays draft pending compatibility acceptance.
Checklist
CHANGELOG.mdunchangedRelated Issues
Related: #1127. Downstream tracking: STR-150. This PR does not retire Starheim's local patch; that still requires a released dependency and fresh consumer verification.
Need help on this PR? Tag
@codesmith-botwith what you need.