fix: make line_ranges optional in read_file tool schema (#9254)

The OpenAI tool schema required both 'path' and 'line_ranges' in FileEntry,
but the TypeScript type definition marks lineRanges as optional. This caused
the AI to fail when trying to read files without specifying line_ranges.

Changes:
- Updated read_file tool schema to only require 'path' parameter
- line_ranges remains available but optional, matching TypeScript types
- Aligns with implementation which treats lineRanges as optional throughout

Fixes issue where read_file tool kept failing with missing parameters.
This commit is contained in:
Daniel 2025-11-13 21:56:51 -05:00 committed by GitHub
parent 01cb12f167
commit 38e3529c1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,7 @@ export const read_file = {
},
},
},
required: ["path", "line_ranges"],
required: ["path"],
additionalProperties: false,
},
minItems: 1,