diff options
Diffstat (limited to 'packages/core/src/utils/fileUtils.ts')
| -rw-r--r-- | packages/core/src/utils/fileUtils.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/core/src/utils/fileUtils.ts b/packages/core/src/utils/fileUtils.ts index 6b5ce42c..c016cd4a 100644 --- a/packages/core/src/utils/fileUtils.ts +++ b/packages/core/src/utils/fileUtils.ts @@ -310,9 +310,22 @@ export async function processSingleFileContent( } llmTextContent += formattedLines.join('\n'); + // By default, return nothing to streamline the common case of a successful read_file. + let returnDisplay = ''; + if (contentRangeTruncated) { + returnDisplay = `Read lines ${ + actualStartLine + 1 + }-${endLine} of ${originalLineCount} from ${relativePathForDisplay}`; + if (linesWereTruncatedInLength) { + returnDisplay += ' (some lines were shortened)'; + } + } else if (linesWereTruncatedInLength) { + returnDisplay = `Read all ${originalLineCount} lines from ${relativePathForDisplay} (some lines were shortened)`; + } + return { llmContent: llmTextContent, - returnDisplay: isTruncated ? '(truncated)' : '', + returnDisplay, isTruncated, originalLineCount, linesShown: [actualStartLine + 1, endLine], |
