OpenCode chat shows an uploaded file as raw text in the user bubble after a reload
When an OpenCode chat is reloaded or reopened, a file uploaded with a prompt appears as raw text inside the user bubble, and the attachment chip is gone.
Steps (OpenCode 1.18.32, web app):
- Start an OpenCode agent, attach a text file (
note.txt) in the composer, and sendRead the attached file and reply with its contents. - Live, the bubble shows a
note.txtattachment chip above the typed text. - Reload the page.
After the reload, the bubble shows this, with the typed text and the metadata joined without a line break:
Read the attached file and reply with its contents.Uploaded file: note.txt
Path: <the daemon's local upload path>
MIME: text/plain
Size: 27 bytesExpected: the same bubble as before the reload, with the typed text and the chip.
The same result appears with and without #5434, which I was testing when I saw it. From the source, the OpenCode adapter sends an uploaded file as a plain text part (renderPromptAttachmentAsText in packages/server/src/server/agent/prompt-attachments.ts). On replay, buildOpenCodeReplayTimelineEvents in packages/server/src/server/agent/providers/opencode-agent.ts joins all of a user message's text parts with "", so it cannot tell the attachment apart from the typed text.
Source: getpaseo/paseo