Skip to content

tui: attached image path is omitted from model context #41454

Description

@opencode-agent

Summary

In OpenCode V2, an image attachment is shown in the TUI with its filename, but the model receives only an image placeholder/content and cannot see the attachment's path or original filename. This prevents the agent from referring to or operating on the attached image as a local file.

Environment

  • opencode version: Unavailable: screenshot does not show a version
  • OS: Unavailable: not provided
  • Terminal: Unavailable: not provided
  • Shell: Unavailable: not provided
  • Install/channel: OpenCode V2 build
  • Active plugins: Unavailable: not provided

Reproduction

  1. Attach a local image to a prompt in the V2 TUI.
  2. Observe that the attachment chip displays its filename (for example, IMG_3480.JPG).
  3. Ask the agent whether it can see the image path or original filename.

Expected Behavior

The model context should include the attachment's path or original filename alongside the image content, allowing the agent to identify and reference the local file.

Actual Behavior

The agent can inspect the attached image as [Image 1], but reports that no filesystem path or original filename is exposed to it and that the image is not automatically available to scripts.

Additional Context

Reproduced in an OpenCode V2 build. The TUI visibly retains the filename, so the metadata appears to be dropped when constructing model input rather than during attachment ingestion.

Requested by: @R44VC0RP (vogel via Slack)

Activity

  1. cakeni commented on Aug 9, 2026

    @cakeni

    I will work on this. I am tracing the V2 TUI local attachment metadata through the prompt request and will add a focused regression test before changing the model input conversion.

  2. cestercian commented on Sep 17, 2026

    @cestercian
    Contributor

    Taking a look at including the attached image path/filename in the model context for V2 attachments.

  3. added 2 commits that reference this issue on Oct 15, 2026
    9296e12
    79ef593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions