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
{{ message }}
Repository navigation
Pasting an image file loses the original path — model only gets an inline data: URL #48190
When an image file is pasted into the TUI composer (pasted path text, or a Finder file copy), the attachment is always submitted as an inline data: URL. The original path only survives in the part's source.path metadata, which the model never sees. After materialization the model effectively has an image and a temp path, so it cannot reference the source file it was given.
The server already does the right thing for file: URL attachments: in packages/opencode/src/session/prompt.ts it emits a synthetic text part with {"filePath": ...} alongside the image. The TUI paste flow just never produces file: URLs, so that path is unreachable.
Secondary symptom on macOS: pasting with the internal paste command (prompt.paste) with a Finder file copy on the clipboard attaches the file's generic icon bitmap, because clipboard.read() requests the clipboard as "PNGf" and the icon flavors win over the file URL/text flavors.
Steps to reproduce
Copy an image file in Finder
Paste it into the TUI composer (it is auto-attached as [Image 1])
Submit and ask the model for the path of the attached image
The model has no path: the part is a data: URL, materialized to a temp file
Activity
github-actions commentedon Sep 9, 2026
This issue might be a duplicate of existing issues. Please check: