fix(read): report both MAX_LINES and MAX_BYTES caps when both are hit#708
Open
Cyning12 wants to merge 1 commit into
Open
fix(read): report both MAX_LINES and MAX_BYTES caps when both are hit#708Cyning12 wants to merge 1 commit into
Cyning12 wants to merge 1 commit into
Conversation
Fixes MoonshotAI#94 — finishMessage uses independent checks so MAX_LINES and MAX_BYTES messages appear together; add regression test. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 602cec1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Cyning12
pushed a commit
to Cyning12/kimi-code
that referenced
this pull request
Jun 13, 2026
…I#708 Move task to done/, record partial graph closeout, and land invoke/review artifacts for path A sign-off. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Fixes #94
Problem
When a file is large enough to trigger both the
MAX_LINES(1000) andMAX_BYTES(100 KiB) limits, the Read tool's<system>status block only reports the line cap and silently omits the byte cap. This happens becausefinishMessageuses anelse ifchain that treats the two limits as mutually exclusive.What changed
finishMessageinpackages/agent-core/src/tools/builtin/file/read.tsto use independentifchecks formaxLinesReachedandmaxBytesReached, so both messages appear together when both limits are hit.End of file reached.(!maxLinesReached && !maxBytesReached && lineCount < requestedLines) to prevent it from being suppressed or incorrectly shown alongside the caps.reports both line and byte caps when both limits are hitthat constructs a file withMAX_LINES + 1lines of 200 characters each, asserting that the output contains both cap messages and does not containEnd of file reached..Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.}