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
Summary
When reloading an ACP session, file attachments are not replayed correctly, causing missing files, lost filenames, and incorrect rendering of text/binary content.
Problem
During session replay:
File parts in stored messages aren’t replayed to ACP clients.
Images lose their original filenames (always shown as “image”).
Binary files (PDFs, etc.) aren’t replayed.
Text files appear as inline text instead of attachments.
Synthetic text parts (LLM context) are incorrectly sent to ACP clients.
Expected
Attachments should be replayed with preserved filenames and correct ACP content block types, and synthetic text should be filtered out.
Actual
Attachments are missing or mis-typed, filenames are lost, and synthetic text is replayed.
Steps to Reproduce
Start an ACP session and attach:
an image (e.g., photo.png),
a PDF (e.g., doc.pdf),
a text file (e.g., notes.txt).
End the session.
Reload the ACP session.
Observe replayed content in the ACP client.
Proposed Solution
Update processMessage() in packages/opencode/src/acp/agent.ts to handle file parts during session replay:
file:// URLs → replay as resource_link
image/* → replay as image blocks, preserving original filename
text/* and application/json → replay as resource with decoded text
binary files → replay as resource with blob
Also update prompt() to:
Preserve filenames from resource_link.name and image.uri
Handle resource.blob by storing file parts with data URLs
Check resource.text truthiness (not just property existence)
Filter !part.synthetic when replaying text
Changes Outline
Add file part handling in processMessage() for replay
Filter synthetic text parts (!part.synthetic)
Preserve filename from resource_link.name in prompt conversion
These issues collectively describe similar ACP session replay and file attachment handling problems. Feel free to ignore if none of these address your specific case.
Activity
github-actions commentedon Jan 18, 2026
This issue might be a duplicate of existing issues. Please check:
session/loaddoes not replay the conversation #4870: ACPsession/loaddoes not replay the conversationThese issues collectively describe similar ACP session replay and file attachment handling problems. Feel free to ignore if none of these address your specific case.