Repository navigation
fix(composer): attach pasted image files as images - #2560
Merged
Merged
Conversation
Screenshot tools such as PixPin put a temporary PNG file, not a bitmap, on the clipboard. Since native disk-file pastes became live path references, those images reached the model as a path plus size, so vision models never saw the pixels and the source could vanish once the tool cleaned its temp directory. Native clipboard raster images within the existing import bounds are now copied into session scratch like picker imports, so they attach as image chips and are stored as content-addressed attachments on send. Other files, SVGs and images beyond the bounds keep the reference flow. fixes #2529
Pass the synthetic native selection directly to the file-reference user-path fixture so Windows file URLs are not parsed as Linux paths. This keeps the Electron journey portable while platform clipboard parsing remains covered by its dedicated tests.
Deploying pi-desktop with
|
| Latest commit: |
ea0136d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1f1fb856.pi-desktop.pages.dev |
| Branch Preview URL: | https://fix-p1-paste-image.pi-desktop.pages.dev |
This was referenced Nov 24, 2026
Closed
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
Continues #2533 on current main, preserving the original contribution. Native clipboard raster images within the import limits become durable image attachments; non-images, SVGs, and out-of-limit files retain the live-reference path. Includes paste-order, source-deletion, image-to-model, and reference-path coverage, plus a Windows fixture-path correction.
Validation
pnpm build:js, desktop typecheck,pnpm lint, architecture checkpnpm test:e2e:composer-pasteand file-reference restart E2E passedpnpm check:pr-base,git diff --checktest:e2e:composer-paste-image-filerequires macOS native pasteboard; the candidate was validated on Windows insteadCloses #2529 after merge. Keep the macOS native pasteboard E2E as an explicit outstanding platform validation before merging.