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
π fix: improve fs_read error message with file count (#796)
* π fix: improve fs_read error message with file count
When fs_read exceeds the maximum tool response size, include the number of files in the error message to provide better context for troubleshooting. This helps users understand why the operation failed and how to adjust their request.
* π fix: improve fs_read error message with file count
When fs_read exceeds the maximum tool response size, include the number of files in the error message to provide better context for troubleshooting. This helps users understand why the operation failed and how to adjust their request.
Copy file name to clipboardExpand all lines: crates/q_cli/src/cli/chat/tools/fs_read.rs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -186,11 +186,12 @@ impl FsRead {
186
186
}
187
187
}
188
188
189
+
let file_count = result.len();
189
190
let result = result.join("\n");
190
191
let byte_count = result.len();
191
192
if byte_count > MAX_TOOL_RESPONSE_SIZE{
192
193
bail!(
193
-
"This tool only supports reading up to {MAX_TOOL_RESPONSE_SIZE} bytes at a time. You tried to read {byte_count} bytes. Try executing with fewer lines specified."
194
+
"This tool only supports reading up to {MAX_TOOL_RESPONSE_SIZE} bytes at a time. You tried to read {byte_count} bytes ({file_count} files). Try executing with fewer lines specified."
0 commit comments