anomalyco / anomalyco/opencode

Reading binary files causes unexpected behavior

Open
#48,310 2 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 10, 2026.

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

Description

Description

When the opencode agent is instructed to read a binary file, it fails to recognize the file type and attempts to read and output the raw binary data. This results in terminal corruption, unreadable output, and fills the LLM context window with garbage data.

Plugins

None

OpenCode version

1.18.30

Steps to reproduce
  1. Start an opencode session in your terminal.
  2. Instruct the agent to read a binary file. For example, you can ask it to read its own binary:
    read the file at /home/[user]/.opencode/bin/opencode
  3. The agent will execute a command similar to:
    $ cat /home/[user]/.opencode/bin/opencode
    
    (or use its internal file reading tool on the binary path).
  4. Observe the terminal output being flooded with binary characters.
Screenshot and/or share link

Opencode binary read issue

Operating System

Linux

Terminal

Standard Terminal

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.