Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: Byte-capped Read reports prefix count as whole-file total

Aperta
#53,230 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@neriousy ci sta già lavorando.

Dal 4/10/2026.

  • #53231 di @Sypher760-gif — aperta
  • #53324 di @kpdagrt22 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Description

The legacy Read tool reports a partial scan count as the whole-file total when it stops at the 50 KiB byte cap. For a 1,000-line file, it returns lines 1–506 with truncated: true but incorrectly reports totalLines: 507.

Steps to reproduce
  1. Create a file containing 1,000 lines of 100 ASCII characters each, joined by newlines without a trailing newline.
  2. Read it with the legacy Read tool from offset 1 with limit 2000.
  3. Inspect the raw tool metadata: the returned range is 1–506 and continuation starts at 507, but totalLines is 507 instead of an unknown total.
Expected behavior

Omit totalLines when the byte cap prevents scanning to EOF. Report the exact total after a complete scan. Returned text and continuation offsets should stay unchanged.

OpenCode version

Source checkout dev at 907b3bc518fa48e90e8ec24dd327d13eee71c36c; Bun 1.3.14 test runtime.

Operating System

Windows 11 x64.

Terminal

Git Bash; native Bun invoked through Python.

Lingua principale
TypeScript
Stelle
212k
Fork
28.1k
Merge medio
9h 58m
PR unite (30g)
373

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.