mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
bug(core): Prompt engineering for truncated read_file. (#5161)
This commit is contained in:
@@ -303,14 +303,7 @@ export async function processSingleFileContent(
|
||||
const contentRangeTruncated =
|
||||
startLine > 0 || endLine < originalLineCount;
|
||||
const isTruncated = contentRangeTruncated || linesWereTruncatedInLength;
|
||||
|
||||
let llmTextContent = '';
|
||||
if (contentRangeTruncated) {
|
||||
llmTextContent += `[File content truncated: showing lines ${actualStartLine + 1}-${endLine} of ${originalLineCount} total lines. Use offset/limit parameters to view more.]\n`;
|
||||
} else if (linesWereTruncatedInLength) {
|
||||
llmTextContent += `[File content partially truncated: some lines exceeded maximum length of ${MAX_LINE_LENGTH_TEXT_FILE} characters.]\n`;
|
||||
}
|
||||
llmTextContent += formattedLines.join('\n');
|
||||
const llmContent = formattedLines.join('\n');
|
||||
|
||||
// By default, return nothing to streamline the common case of a successful read_file.
|
||||
let returnDisplay = '';
|
||||
@@ -326,7 +319,7 @@ export async function processSingleFileContent(
|
||||
}
|
||||
|
||||
return {
|
||||
llmContent: llmTextContent,
|
||||
llmContent,
|
||||
returnDisplay,
|
||||
isTruncated,
|
||||
originalLineCount,
|
||||
|
||||
Reference in New Issue
Block a user