fix(cli): reduce read context overhead from line prefixes#10610
Open
marius-kilocode wants to merge 2 commits into
Open
fix(cli): reduce read context overhead from line prefixes#10610marius-kilocode wants to merge 2 commits into
marius-kilocode wants to merge 2 commits into
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The change is a clean, well-scoped one-liner in Files Reviewed (6 files)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 489,383 tokens Review guidance: REVIEW.md from base branch |
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.
Why this change
Ordinary text reads currently add a line-number prefix to every returned source line, even though Kilo edits match source text or patch context rather than displayed line positions. This adds repeated context overhead on a high-frequency tool path without providing input required by the editing tools.
Current model-visible output:
This PR returns the ordinary source text instead:
Partial reads still report their original line range in the continuation notice, so bounded navigation remains available without repeating positional prefixes on every content line.
Measured motivation
This change is based on an aggregate internal measurement of completed Kilo
readtool outputs, not only on an implementation hypothesis. We measured the model-visible text attributable to the repeated line-number prefixes and found that they account for about 10% of storedreadoutput payload in the analyzed sample.That percentage describes removable context text, not exact billed tokens or cost. Tool outputs can be retained, cached, or replayed in later model steps, so paired before/after session accounting is still needed to quantify the billing impact. Absolute usage, token, and cost figures are intentionally not included here.
Why line prefixes are removable
edituses exact or flexible textualoldStringreplacement; displayed line-number prefixes are not consumed by the tool.apply_patchlocates contextual source chunks rather than applying changes at displayed line positions.Preserved behavior
This PR intentionally changes only the repeated line prefixes for ordinary text file contents.
<path>,<type>, and<content>envelope<system-reminder>delivery for scoped instructionsUpstream origin and intent
The numbered format is inherited upstream behavior, originally chosen for navigation clarity rather than edit correctness.
AGENTS.mdresolution as an agent explores directories. That separate correctness behavior is retained here.<path>,<type>, and<content>read output and adjusted editing guidance. The structural envelope is retained here.<content>to make the structured result unambiguous. That clarity behavior is retained here.Comparable harness behavior
Other agent harnesses show that text editing and scoped navigation do not require mandatory prefixes on every source line.
apply_patch, without relying on a mandatory dedicated numbered file-read output.Follow-up measurement
The intended outcome is lower read-related prompt context without a meaningful regression in editing or navigation. Evaluation should compare model-visible read output, prompt-side usage, edit retries, and file-location reporting quality before making a quantitative savings claim about billed usage or cost.