anomalyco / anomalyco/opencode

Read tool skips a blank line at a pagination boundary

Open
#47,419 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

A paginated read can silently skip a blank line. The reader includes it, but model-content serialization removes it while retaining the continuation offset beyond it.

Plugins

Built-in read tool; no external plugins.

OpenCode version

V2 source checkout at 541937d12449e64d078c67e9013f1c288004b83f.

Steps to reproduce
  1. Create a temporary file containing "alpha\n\nomega\n".
  2. Read it with offset: 1 and limit: 2.
  3. Inspect the text returned to the model.

Expected: lines 1–2, including a numbered blank second line, then continuation at 3. Actual: the heading says lines 1–1, only alpha is shown, and continuation still starts at 3. Reading three lines or the whole file preserves the internal blank line.

Operating System

macOS arm64, Bun 1.4.1.

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 with the built-in read tool and the model-content serialization path, then reproduce the issue using a file containing "alpha\n\nomega\n" with offset 1 and limit 2. Done means the returned text includes the numbered blank second line while continuation still starts at line 3, without changing behavior for larger reads.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.