From 830b6faddbed1204fc29a1516b2e09a575a6f49f Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Thu, 13 Nov 2025 21:47:29 -0500 Subject: [PATCH] fix: make line_ranges optional in read_file tool schema 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. --- src/core/prompts/tools/native-tools/read_file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/prompts/tools/native-tools/read_file.ts b/src/core/prompts/tools/native-tools/read_file.ts index 7918826833d..6118f585870 100644 --- a/src/core/prompts/tools/native-tools/read_file.ts +++ b/src/core/prompts/tools/native-tools/read_file.ts @@ -30,7 +30,7 @@ export const read_file = { }, }, }, - required: ["path", "line_ranges"], + required: ["path"], additionalProperties: false, }, minItems: 1,