Repository navigation
fix(core): preserve unsupported image attachments as text instead of dropping them - #41723
Robin1987China wants to merge 1 commit into
Conversation
|
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. |
d50800d to
834a515
Compare
834a515 to
984f5c1
Compare
|
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 |
Overall: Good fix — silently swallowing an attached image is a nasty failure mode, and surfacing a named placeholder keeps the conversation honest. Suggestions:
|
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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