Commit da8451b
cellwebb
fix(tools): improve read_lines out-of-bounds handling
- Return error only when entire requested range is outside file bounds
- Clamp to file end when only upper boundary exceeds file length
- Store original values for accurate error messages
- Apply same behavior for both direct calls and executor usage
- Improves robustness for agents requesting line ranges
Examples:
- '3-10' in 5-line file → returns lines 3-5 (clamped)
- '8-12' in 5-line file → returns error (entire range outside)
- '10' in 5-line file → returns error (single line outside)1 parent 7210308 commit da8451b
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | 183 | | |
176 | | - | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| |||
0 commit comments