fix(coding-agent): use async operations in tools
This commit is contained in:
@@ -50,13 +50,12 @@ export async function processFileArguments(fileArgs: string[], options?: Process
|
||||
if (mimeType) {
|
||||
// Handle image file
|
||||
const content = await readFile(absolutePath);
|
||||
const base64Content = content.toString("base64");
|
||||
|
||||
let attachment: ImageContent;
|
||||
let dimensionNote: string | undefined;
|
||||
|
||||
if (autoResizeImages) {
|
||||
const resized = await resizeImage({ type: "image", data: base64Content, mimeType });
|
||||
const resized = await resizeImage(content, mimeType);
|
||||
if (!resized) {
|
||||
text += `<file name="${absolutePath}">[Image omitted: could not be resized below the inline image size limit.]</file>\n`;
|
||||
continue;
|
||||
@@ -71,7 +70,7 @@ export async function processFileArguments(fileArgs: string[], options?: Process
|
||||
attachment = {
|
||||
type: "image",
|
||||
mimeType,
|
||||
data: base64Content,
|
||||
data: content.toString("base64"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user