Skip to content

fix: treat maxReadFileLine=0 as unlimited (same as -1)#5575

Merged
kevinvandijk merged 4 commits intoKilo-Org:mainfrom
Patel230:fix/maxReadFileLine-zero-value
Feb 15, 2026
Merged

fix: treat maxReadFileLine=0 as unlimited (same as -1)#5575
kevinvandijk merged 4 commits intoKilo-Org:mainfrom
Patel230:fix/maxReadFileLine-zero-value

Conversation

@Patel230
Copy link
Contributor

@Patel230 Patel230 commented Feb 1, 2026

Summary

Fixes #5535

Users setting maxReadFileLine to 0 expect it to mean 'no limit', similar to -1. Previously, setting this to 0 would throw an error, breaking file reads when using @file mentions.

Changes

  • Modified validation logic to treat 0 as valid (unlimited)
  • Modified truncation logic to skip truncation when 0
  • Updated test to expect success instead of error

Before vs After

Value Before After
-1 ✅ Unlimited ✅ Unlimited
0 Error Unlimited
5 ✅ Read 5 lines ✅ Read 5 lines

Testing

  • All 12 tests in extract-text-large-files.spec.ts pass
  • Linting passes
  • Manual verification confirms fix works

Users setting maxReadFileLine to 0 expect it to mean 'no limit',
similar to -1. This fix ensures 0 is treated as unlimited,
preventing errors when using @file mentions with this setting.

Fixes Kilo-Org#5535
@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2026

🦋 Changeset detected

Latest commit: c43b9b4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

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

Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

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

Thanks!

@kevinvandijk kevinvandijk merged commit 6c37973 into Kilo-Org:main Feb 15, 2026
12 checks passed
@Patel230
Copy link
Contributor Author

Thanks!

Thank you @kevinvandijk

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.

maxReadFileLine interferes with including files using @file

2 participants

Comments