Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭
#53,230 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@neriousy 已经在做这个了。

开始于 2026年10月4日。

  • #53231 来自 @Sypher760-gif —— 已关闭,未合并
  • #53324 来自 @kpdagrt22 —— 已关闭,未合并

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
TypeScript
星标
221k
派生
29.6k
平均合并
5 小时 32 分钟
30 天内合并 PR
492

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。