Repository navigation
Conversation
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.
Summary
tool_resultblocks as Chat Completionsimage_urlinput instead of serializing their Base64 data into tool-message text.Why
The previous conversion used
JSON.stringify()for non-text tool results. Six screenshots in a real Gemini request consequently became approximately 1.37 million characters of ordinary Base64 text rather than multimodal input. The preceding accepted request already consumed 1,048,204 input tokens; the next tool turn was rejected by Copilot with HTTP 400invalid_request_body.A controlled one-field text-size reduction restored the rejected request, while restoring or removing reasoning signatures did not. This change fixes the image conversion itself rather than altering signatures, retries, or feature flags.
Verification
@floway-dev/translate.git diff --checkpassed.image_urlparts and used the default WebP compression.Scope
This PR contains only the translation fix and its regression tests. It does not include playground changes, the separate Copilot image-generation feature, dependency changes, or database migrations.