fix(core): preserve unsupported image attachments as text instead of dropping them - #41723
Open
Robin1987China wants to merge 1 commit into
Open
fix(core): preserve unsupported image attachments as text instead of dropping them#41723Robin1987China wants to merge 1 commit into
Robin1987China wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Robin1987China
force-pushed
the
preserve-unsupported-images
branch
from
August 12, 2026 02:33
d50800d to
834a515
Compare
Robin1987China
force-pushed
the
preserve-unsupported-images
branch
from
August 12, 2026 07:30
834a515 to
984f5c1
Compare
Contributor
Author
|
Rebased onto the latest v2 — #41789 (expose local attachment paths) has landed, so the two changes now coexist in the same lowering path: supported images get the |
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 #41722
Type of change
What does this PR do?
In V2,
to-llm-message.tsonly lowersimage/png|jpeg|gif|webpattachments to provider media; any other image mime (e.g.image/avif,image/tiff) returned[]fromattachmentContent, silently dropping the attachment. The TUI file picker accepts.avifand inserts an[Image N]mention, so the model saw the label but never the content (or a notice that it was dropped).This PR lowers unsupported image formats to a descriptive text attachment (mime + name + reason) instead of dropping them, so the model is aware the user attached an image it cannot view and can respond appropriately instead of referencing a nonexistent image.
How did you verify your code works?
packages/core/test/session-runner-message.test.tscovering animage/avifattachmentbun test test/session-runner-message.test.ts— 19 passbun typecheck(packages/core) — cleanChecklist