anomalyco / anomalyco/opencode

v2: read tool duplicates subdirectory AGENTS.md content

Open
#38,744 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Jul 24, 2026.

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

Description

Reading a subdirectory AGENTS.md via the read tool loads it twice — once as the tool result and again as a synthetic instruction message. The candidates filter at packages/core/src/tool/read.ts:99 excludes only the Location-root AGENTS.md, not the path just read.

Plugins

N/A

OpenCode version

v2

Steps to reproduce
  1. Put an AGENTS.md in a project subdirectory.
  2. Start a session at the project root.
  3. Have the agent read a file in that subdirectory.
  4. The AGENTS.md appears both as the read tool result and as a Instructions from: <path> synthetic message.
Screenshot and/or share link

N/A

Operating System

N/A

Terminal

N/A

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.