Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#53,230 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@neriousy đang làm issue này rồi.

Từ ngày 4/10/2026.

  • #53231 của @Sypher760-gif — đã đóng, không merge
  • #53324 của @kpdagrt22 — đã đóng, không merge

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
4 giờ 35 phút
Pull request đã merge (30 ngày)
521

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.