Repository navigation
fix(opencode): bump @ai-sdk/xai to 3.0.139 so tool-result images reach xAI - #53549
Merged
Merged
Conversation
…h xAI @ai-sdk/xai 3.0.102 flattens function_call_output content to text, so an image returned by the read tool reached xAI as the bare string "Image read successfully". 3.0.139 (latest on the ai v6 line) maps image-data/image-url parts to input_image. Port the local patch (promptCacheKey, inline PDF input_file, free-form reasoningEffort) to the new version. Image types xAI rejects (e.g. GIF) keep the text placeholder.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
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.
Issue for this PR
Closes #53548
Type of change
What does this PR do?
When a tool like
readreturned an image,@ai-sdk/xai3.0.102 sent xAI only the text "Image read successfully", so the model never saw the image. Version 3.0.139 sends the image itself; this bumps it and moves our existing patch over to the new version.How did you verify your code works?
A new test that fails on the old version, plus typecheck and lint. I also checked by hand that grok-4.7 now describes the actual image.
Test image (
assets/sample.png, read with the prompt "Read assets/sample.png and describe exactly what the image shows, including any text in it.")Before
Wrong answer, "A small solid red square centered on a plain white background. No text or other symbols."; the image has no red and no square.
After
Correct answer, "A dark navy blue background with the white bold text “PELICAN 739” centered at the top. Below it, a yellow five-pointed star sits on the left and a solid green triangle on the right."
Screenshots / recordings
N/A
Checklist