Repository navigation
Show an actionable error when a pasted image can't be attached - #1643
Merged
currentbits merged 6 commits intoOct 16, 2026
Merged
Conversation
added 2 commits
October 15, 2026 16:51
Solenta-Message-Id: d8709427-9bf2-4a1c-87a6-7155802519bd
Solenta-Message-Id: 8524452a-15be-41be-87e1-25cdbc5edbb1
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
On Windows CI the first test's debounced async flush ran after done() removed the dir, logged "[store] async flush failed", and the next test's console-error check failed it. saveNow() supersedes the in-flight flush so it cannot log, and flushPending() waits for it to settle before rmSync. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…onable-error-when-an-imag-5607f9
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.
Fixes #1211. Pasting an image calls
preventDefault, so the paste is used up. Before this change, a failed save left no chip and no message, and the image simply disappeared.What changed
Composer.tsxEvery pasted image now ends up either as an attachment chip or as a visible error in the composer.
When the clipboard item or
FileReadercan't produce data (no blob, read error/abort, empty result), it shows "Couldn't read the pasted image. Copy it again, or attach it from a file."When the host returns
null,pasteRejectReasongives a likely cause in terms of what to do next:These values copy
EXT_BY_MEDIA/MAX_IMAGE_BYTESfromelectron/attachments.js, which returnsnullwithout saying why.When the save rejects, the host's error message is shown.
With several images in one paste, the errors are collected into one message ("N of M pasted images weren't attached. …"), with repeated reasons removed. A paste where every image succeeds clears any earlier error.
The error is only set if the user is still on the thread where they pasted, so it doesn't show up on another thread.
useCoderWorkspace.ts/useCoder.tssaveAttachmentImageno longer swallows errors. It now rejects with the host's error so the paste path can show it.saveImageOrNullwrapper keeps the old behaviour (skip the item quietly) for batch paths: web file pick, video-frame extraction, and drag/drop from paths or files.UseCoderResultdoc comment to match.Tests
test/pasteImageErrors.test.tsx(new) covers the paste error messages.test/composerAttachments.test.tsxhas more composer attachment cases.🤖 Generated with Claude Code