Skip to content

Conversation

@liorshk
Copy link
Collaborator

@liorshk liorshk commented Dec 29, 2025

Merges the file attachment fixes from liorshk/opencode.

Changes

  • Replay file parts as ACP content blocks (images, binary resources, text resources)
  • Filter synthetic parts during replay
  • Whitelist binary content for LLM (image/audio/video/pdf as file parts, everything else as text)

See PR anomalyco#6342 on sst/opencode for full details.

actions-user and others added 30 commits December 26, 2025 12:10
Co-authored-by: Github Action <action@github.com>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
actions-user and others added 29 commits December 28, 2025 18:54
Co-authored-by: OpenCode <opencode@example.com>
…o#6332)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…yco#6306)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
…malyco#6304)

Co-authored-by: OpenCode <opencode@example.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
- Store ACP resources as file parts to preserve filename and mimeType
- Add file part handling in processMessage for proper session replay
- Decode text-based files for LLM compatibility in toModelMessage
- Preserve original filename from image URI instead of hardcoding 'image'
- Skip binary non-image files during ACP replay (resource blocks only support text)
- Follow style guide: avoid else statements, use Buffer instead of atob/btoa
- Filter synthetic text parts during ACP replay to avoid showing internal messages
- Convert ACP resources to data URLs preserving original filename from URI
- Use whitelist approach for binary content (image/audio/video/pdf) instead of blacklisting text MIME types
- Handle edge cases where resource has empty text/blob fields
@liorshk liorshk closed this Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.