mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: bypass maxReadFileLine for @ mentioned files
When a user explicitly @ mentions a file, they expect to see the full content regardless of the maxReadFileLine setting. This change ensures that @ mentioned files always use -1 (unlimited) for maxReadFileLine, bypassing the auto-truncate threshold. Changes: - Modified getFileOrFolderContent to always pass -1 to extractTextFromFile - This applies to both individual file mentions and files in folder mentions - The maxReadFileLine setting continues to work for tool-based file reads
This commit is contained in:
parent
ae655c5d29
commit
3718b1c3a9
1 changed files with 4 additions and 2 deletions
|
|
@ -278,7 +278,8 @@ async function getFileOrFolderContent(
|
|||
return `(File ${mentionPath} is ignored by .rooignore)`
|
||||
}
|
||||
try {
|
||||
const content = await extractTextFromFile(absPath, maxReadFileLine)
|
||||
// Always read full file for @ mentions (bypass maxReadFileLine)
|
||||
const content = await extractTextFromFile(absPath, -1)
|
||||
return content
|
||||
} catch (error) {
|
||||
return `(Failed to read contents of ${mentionPath}): ${error.message}`
|
||||
|
|
@ -318,7 +319,8 @@ async function getFileOrFolderContent(
|
|||
if (isBinary) {
|
||||
return undefined
|
||||
}
|
||||
const content = await extractTextFromFile(absoluteFilePath, maxReadFileLine)
|
||||
// Always read full file for @ mentions (bypass maxReadFileLine)
|
||||
const content = await extractTextFromFile(absoluteFilePath, -1)
|
||||
return `<file_content path="${filePath.toPosix()}">\n${content}\n</file_content>`
|
||||
} catch (error) {
|
||||
return undefined
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue