From 756cbfcf28eb36b945ab619392871945b23fd5bc Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sat, 20 Dec 2025 21:37:20 +0000 Subject: [PATCH] fix: correct line_range to line_ranges in truncation notice messages --- src/core/tools/ReadFileTool.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/tools/ReadFileTool.ts b/src/core/tools/ReadFileTool.ts index d15a3ba76a..9dd893b0ea 100644 --- a/src/core/tools/ReadFileTool.ts +++ b/src/core/tools/ReadFileTool.ts @@ -458,7 +458,7 @@ export class ReadFileTool extends BaseTool<"read_file"> { task.rooIgnoreController, ) if (defResult) { - const notice = `Showing only definitions of ${totalLines} total lines. To read actual content, use the read_file tool again with the line_range parameter (e.g., line_ranges: [[1, 500]])` + const notice = `Showing only definitions of ${totalLines} total lines. To read actual content, use the read_file tool again with the line_ranges parameter (e.g., line_ranges: [[1, 500]])` updateFileResult(relPath, { xmlContent: `${relPath}\n${defResult}\n${notice}\n`, nativeContent: `File: ${relPath}\nCode Definitions:\n${defResult}\n\nNote: ${notice}`, @@ -495,7 +495,7 @@ export class ReadFileTool extends BaseTool<"read_file"> { const nextStart = maxReadFileLine + 1 const suggestedEnd = Math.min(maxReadFileLine * 2, totalLines) - const notice = `Showing lines 1-${maxReadFileLine} of ${totalLines} total lines. To continue reading, use the read_file tool again with the line_range parameter starting at line ${nextStart} (e.g., line_ranges: [[${nextStart}, ${suggestedEnd}]])` + const notice = `Showing lines 1-${maxReadFileLine} of ${totalLines} total lines. To continue reading, use the read_file tool again with the line_ranges parameter starting at line ${nextStart} (e.g., line_ranges: [[${nextStart}, ${suggestedEnd}]])` xmlInfo += `${notice}\n` nativeInfo += `\nNote: ${notice}` @@ -552,7 +552,7 @@ export class ReadFileTool extends BaseTool<"read_file"> { // File was truncated const nextStart = result.lineCount + 1 const suggestedEnd = Math.min(result.lineCount * 2, totalLines) - const notice = `File truncated: showing lines 1-${result.lineCount} of ${totalLines} total (${result.tokenCount} tokens) due to context budget. To continue reading, use the read_file tool again with the line_range parameter starting at line ${nextStart} (e.g., line_ranges: [[${nextStart}, ${suggestedEnd}]])` + const notice = `File truncated: showing lines 1-${result.lineCount} of ${totalLines} total (${result.tokenCount} tokens) due to context budget. To continue reading, use the read_file tool again with the line_ranges parameter starting at line ${nextStart} (e.g., line_ranges: [[${nextStart}, ${suggestedEnd}]])` const lineRangeAttr = result.lineCount > 0 ? ` lines="1-${result.lineCount}"` : "" xmlInfo = result.lineCount > 0