From e098a86e4bbc4505743f566aba1de4dc6081c660 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 22 Dec 2025 23:19:30 -0700 Subject: [PATCH] fix: remove unused FileEntry.limit from types and parser The limit parameter was defined in FileEntry but intentionally ignored by ReadFileTool since the line limit is controlled by the maxReadFileLine setting. This removes the unused type field and parsing code to align the types with actual behavior. - Remove limit from FileEntry interface in tool-params.ts - Remove limit parsing from NativeToolCallParser.convertFileEntries() - Remove limit from FileResult interface in ReadFileTool.ts - Update comment to remove obsolete limit mention --- packages/types/src/tool-params.ts | 2 -- src/core/assistant-message/NativeToolCallParser.ts | 8 -------- src/core/tools/ReadFileTool.ts | 3 +-- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/types/src/tool-params.ts b/packages/types/src/tool-params.ts index 5d18657dae..bb408c18e3 100644 --- a/packages/types/src/tool-params.ts +++ b/packages/types/src/tool-params.ts @@ -27,8 +27,6 @@ export interface FileEntry { path: string /** 1-indexed line number to start reading from (default: 1) */ offset?: number - /** Maximum number of lines to return (default: 2000) */ - limit?: number /** Reading mode: "slice" for simple reading, "indentation" for smart block extraction */ mode?: ReadMode /** Configuration for indentation mode */ diff --git a/src/core/assistant-message/NativeToolCallParser.ts b/src/core/assistant-message/NativeToolCallParser.ts index 4d3e4e55fd..11d38a6a6a 100644 --- a/src/core/assistant-message/NativeToolCallParser.ts +++ b/src/core/assistant-message/NativeToolCallParser.ts @@ -315,14 +315,6 @@ export class NativeToolCallParser { } } - // Map limit parameter - if (file.limit !== undefined) { - const limit = Number(file.limit) - if (!isNaN(limit) && limit > 0) { - entry.limit = limit - } - } - // Map mode parameter if (file.mode === "slice" || file.mode === "indentation") { entry.mode = file.mode diff --git a/src/core/tools/ReadFileTool.ts b/src/core/tools/ReadFileTool.ts index 09f8be4f92..a7f5e4fb50 100644 --- a/src/core/tools/ReadFileTool.ts +++ b/src/core/tools/ReadFileTool.ts @@ -37,7 +37,6 @@ interface FileResult { notice?: string // Slice/indentation mode parameters offset?: number - limit?: number mode?: ReadMode indentation?: IndentationConfig xmlContent?: string @@ -105,7 +104,7 @@ export class ReadFileTool extends BaseTool<"read_file"> { const fileResults: FileResult[] = fileEntries.map((entry) => ({ path: entry.path, status: "pending", - // Map slice/indentation mode parameters (limit is not mapped - always use maxReadFileLine setting) + // Map slice/indentation mode parameters offset: entry.offset, mode: entry.mode, indentation: entry.indentation,