Skip to content

Fix read file tool to respect start_line and end_line parameters#29

Merged
tcdent merged 1 commit intomainfrom
claude/fix-file-line-numbers-hmjt0
Jan 15, 2026
Merged

Fix read file tool to respect start_line and end_line parameters#29
tcdent merged 1 commit intomainfrom
claude/fix-file-line-numbers-hmjt0

Conversation

@tcdent
Copy link
Owner

@tcdent tcdent commented Jan 15, 2026

Two bugs were fixed:

  1. The start_line and end_line parameters were parsed but never used -
    they were marked #[allow(dead_code)] and not passed to the handler
  2. Even if line filtering was implemented, line numbers would show 1, 2, 3
    instead of the actual file line numbers

Changes:

  • Updated io::read_file() to accept optional start_line and end_line params
  • Updated ReadFile handler to pass line range parameters
  • Updated ReadFileTool::compose() to pass params from the parsed request
  • Added proper tests verifying both line filtering and correct numbering

Two bugs were fixed:
1. The start_line and end_line parameters were parsed but never used -
   they were marked #[allow(dead_code)] and not passed to the handler
2. Even if line filtering was implemented, line numbers would show 1, 2, 3
   instead of the actual file line numbers

Changes:
- Updated io::read_file() to accept optional start_line and end_line params
- Updated ReadFile handler to pass line range parameters
- Updated ReadFileTool::compose() to pass params from the parsed request
- Added proper tests verifying both line filtering and correct numbering
@tcdent tcdent merged commit 4227661 into main Jan 15, 2026
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.

2 participants