anomalyco / anomalyco/opencode

tui: attached image path is omitted from model context

Open
#41,454 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.0 bug
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the V2 TUI, then trace how the attachment chip's filename and path move from ingestion into model input. Identify where the metadata is dropped and ensure the model context preserves the attachment path or original filename alongside the image content; verify by asking the agent to identify the attached file.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.