Skip to content

OPE-55: Attachments #403

Closed
Closed

Description

@ivanfenenko

Let users add device photos, PDFs, and text-like files to a Session Chat prompt on iOS and Android so the opencode server receives the same local Attachment context desktop already supports.

Product language: Attachment (pending in the composer, sent as FilePart). There is no multipart upload API — encode data: URLs into FilePartInput on prompt_async.

What to build

End-to-end Attachments in Session Chat on both platforms:

  • Rename the composer affordance to Attach / Add attachment and open Photos + Files pickers (no camera in v1).
  • Accept images (png/jpeg/gif/webp), PDF, and text-like files; reject other binaries; allow multiple pending chips and attachment-only send.
  • Extend domain + send path with pending Attachment and visible FilePart; include data-URL file parts on prompt_async.
  • Clear text and pending Attachments on HTTP 204; keep them on non-2xx for retry; surface post-204 Session.Event.Error without restoring chips.
  • Render attachment rows on user messages (image thumbnail or file card); PDF/text may open a system viewer/share sheet.
  • Add design-system attachment chip and message-attachment primitives before feature glue.
  • Keep iOS and Android behavior synchronized; record intentional Parity Gaps only when needed.

Acceptance criteria

  • User can attach at least one image, one PDF, and one text-like file and see removable pending chips before send.
  • Unsupported types are rejected with clear copy; draft text is preserved.
  • Send issues prompt_async with text and/or FilePartInput data-URL parts; attachment-only send works.
  • HTTP 204 clears text and pending Attachments; non-2xx keeps both for retry.
  • Post-204 session errors surface in Session Chat without restoring chips.
  • User messages with data-URL file parts show attachment rows after refresh/SSE.
  • Composer label is Attach / Add attachment (not Attach context).
  • No project file:// / @ browser, camera, multipart upload, or in-app PDF reader.
  • iOS and Android match behavior and copy semantics.

Remaining

  • Design-system attachment chip / message-attachment primitives
  • Domain FilePart + Attachment model + send builder on both platforms
  • Composer pickers + pending chips + Attach label
  • Timeline attachment-row rendering
  • Session.Event.Error surfacing for post-204 failures
  • Cross-platform validation

Out of scope

Project @ / file:// context, camera, drag-and-drop, MCP attach, client image editor, hard client resize, in-app PDF reader.

Blocked by

None — can start immediately.

Docs: docs/features/file-attachments/
Research: docs/research/opencode-file-upload.md


Imported from Linear OPE-55. Linear status: Done. Priority: Medium. Created 2026-07-16. Completed 2026-07-17.
Related: OPE-11.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. added
    enhancement
    ios
    android
    shared
    priority: medium
    ready-for-agent
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

androidenhancementiospriority: mediumready-for-agentshared

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions