You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return`[${blockName} for '${paths[0]}'. Reading multiple files at once is more efficient for the LLM. If other files are relevant to your current task, please read them simultaneously.]`
31
+
}elseif(paths.length<=3){
32
+
constpathList=paths.map((p)=>`'${p}'`).join(", ")
33
+
return`[${blockName} for ${pathList}]`
34
+
}else{
35
+
return`[${blockName} for ${paths.length} files]`
36
+
}
37
+
}catch(error){
38
+
console.error("Failed to parse read_file args XML for description:",error)
39
+
return`[${blockName} with unparseable args]`
40
+
}
41
+
}elseif(blockParams.path){
42
+
// Fallback for legacy single-path usage
43
+
// Modified part for single file (legacy)
44
+
return`[${blockName} for '${blockParams.path}'. Reading multiple files at once is more efficient for the LLM. If other files are relevant to your current task, please read them simultaneously.]`
45
+
}else{
46
+
return`[${blockName} with missing path/args]`
47
+
}
48
+
}
18
49
// Types
19
50
interfaceLineRange{
20
51
start: number
@@ -164,7 +195,8 @@ export async function readFileTool(
164
195
165
196
try{
166
197
// First validate all files and get approvals
167
-
for(constfileResultoffileResults){
198
+
for(leti=0;i<fileResults.length;i++){
199
+
constfileResult=fileResults[i]
168
200
constrelPath=fileResult.path
169
201
constfullPath=path.resolve(cline.cwd,relPath)
170
202
@@ -216,6 +248,9 @@ export async function readFileTool(
0 commit comments