Preserve Gemini tool arguments and text thought signatures - #239
Open
mattt wants to merge 3 commits into
Open
Conversation
mattt
marked this pull request as draft
September 11, 2026 17:28
There was a problem hiding this comment.
🟢 Approval recommended
The implementation addresses both reported regressions with focused persistence changes and comprehensive request-level tests.
Pull request overview
Fixes Gemini transcript replay by preserving semantic tool arguments and signed text-part metadata across turns and serialization.
Changes:
- Replays tool arguments from semantic JSON.
- Persists and restores signed text-part boundaries.
- Adds streaming and transcript round-trip coverage.
File summaries
| File | Description |
|---|---|
Sources/AnyLanguageModel/Models/GeminiLanguageModel.swift |
Preserves Gemini arguments and signed text parts. |
Sources/AnyLanguageModel/LanguageModelSession.swift |
Carries provider metadata into transcripts. |
Sources/AnyLanguageModel/Transcript.swift |
Adds persisted turn-level provider metadata. |
Tests/AnyLanguageModelTests/GeminiThoughtSignatureTests.swift |
Covers arguments, signatures, ordering, and streaming. |
Tests/AnyLanguageModelTests/TranscriptTests.swift |
Tests provider-metadata Codable behavior. |
Tests/AnyLanguageModelTests/Shared/StubURLProtocol.swift |
Adds SSE response support. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mattt
marked this pull request as ready for review
September 11, 2026 17:43
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.
Gemini conversation history currently wraps tool arguments in
GeneratedContent’s persistence format and drops thought signatures on text parts. This PR replays arguments from their semantic JSON and preserve signed text with its original part boundaries and position among tool calls.Fixes #235
Fixes #221