Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-lands-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Reduce the incidence of read_file errors when using Claude models.
17 changes: 17 additions & 0 deletions src/core/prompts/tools/native-tools/read_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI.
" }] }. " +
"The 'path' is required and relative to workspace. "

// kilocode_change start
const example = {
files: [
{
path: "relative/path.ts",
line_ranges: partialReadsEnabled
? [
[1, 50],
[100, 150],
]
: undefined,
},
],
}
// kilocode_change end

const optionalRangesDescription = partialReadsEnabled
? "The 'line_ranges' is optional for reading specific sections. Each range is a [start, end] tuple (1-based inclusive). "
: ""
Expand Down Expand Up @@ -81,6 +97,7 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI.
},
},
required: ["files"],
examples: [example], // kilocode_change
additionalProperties: false,
},
},
Expand Down