anomalyco / anomalyco/opencode
V2 read tool dropped line numbers that V1 returned
@nexxeln is already working on this.
Since Jul 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
V1 read prefixed every line with its number: ${i + offset}: ${line} (packages/opencode/src/tool/read.ts), and its tool description stated "Contents are returned with each line prefixed by its line number as <line>: <content>". V2 returns plain text — TextPage.content is just lines.join("\n") (packages/core/src/tool/read-filesystem.ts), with only offset/next metadata and no per-line numbers.
Without line numbers in the returned content, the model frequently reports incorrect line numbers to the user. Most other agents (Claude Code, Kimi-CLI, etc.) return cat -n-style line numbers and document it in the tool description.
Plugins
No response
OpenCode version
V2 (latest origin/v2)
Steps to reproduce
- Use the V2
readtool on any text file - Observe the returned
TextPage.contentis plain text with no line numbers - Compare with V1 which returned
${i + offset}: ${line}per line
Operating System
Linux
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.