Skip to content

fix(read): report maxLinesReached in tail mode#778

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-20260615-1800
Open

fix(read): report maxLinesReached in tail mode#778
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-20260615-1800

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

Problem

When reading from the tail with line_offset=-MAX_LINES, the Read tool never reported maxLinesReached even though it hit the cap. This made tail mode inconsistent with forward mode, where the cap is correctly reported.

What changed

  • Set maxLinesReached in readTail when effectiveLimit >= MAX_LINES and entries.length >= effectiveLimit.
  • Add regression test ensuring tail mode reports the cap.

Checklist

  • I have read the CONTRIBUTING document.
  • I have explained the problem above.
  • I have added tests that prove my feature works.

When reading from the tail with line_offset=-MAX_LINES, the Read tool
never reported maxLinesReached even though it hit the cap. This made
tail mode inconsistent with forward mode.

- Set maxLinesReached in readTail when effectiveLimit >= MAX_LINES and
  entries.length >= effectiveLimit.
- Add regression test ensuring tail mode reports the cap.
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1895c2f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 15, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@1895c2f
npx https://pkg.pr.new/@moonshot-ai/kimi-code@1895c2f

commit: 1895c2f

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1895c2feaf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

renderedLines,
truncatedLineNumbers,
maxLinesReached: false,
maxLinesReached: effectiveLimit >= MAX_LINES && entries.length >= effectiveLimit,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid reporting the line cap for exact-size tail reads

When line_offset is -MAX_LINES and the file contains exactly MAX_LINES lines, entries.length equals effectiveLimit even though no content was omitted by the internal cap, so the result now reports Max 1000 lines reached. for a complete read. Forward reads only set this flag after seeing an extra eligible line; tail mode needs the same distinction, e.g. requiring more total lines than the retained tail window/effective limit.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant