You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you paste or drag an image into the prompt, the agent only gets raw pixel data. It doesn't know where the original file is, so asking it to copy or reference the image fails. The agent's thinking shows "I don't have a direct file path" and it tries to decode base64 instead.
This preserves the file path through the attachment flow and exposes it to the model as text, so the agent can actually use it.
How did you verify your code works?
Ran bun typecheck in packages/opencode and packages/app — both pass
Ran bun test for the affected app test files — all pass
Ran bun run dev locally, pasted an image, and confirmed the agent now sees the path
Related because it addresses drag-drop image path handling, which is directly related to the current PR's focus on preserving image attachment file paths
Related because it addresses clipboard paste and drag-and-drop file handling, which overlaps with the current PR's concern about pasted/dragged images
These PRs appear to be addressing the same general problem space of making file paths available when users paste or drag images. The current PR (23802) may build on or supersede these earlier attempts.
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
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 #23801
Closes #17488
Type of change
What does this PR do?
When you paste or drag an image into the prompt, the agent only gets raw pixel data. It doesn't know where the original file is, so asking it to copy or reference the image fails. The agent's thinking shows "I don't have a direct file path" and it tries to decode base64 instead.
This preserves the file path through the attachment flow and exposes it to the model as text, so the agent can actually use it.
How did you verify your code works?
Screenshots / recordings
Checklist