fix(coding-agent): use async operations in tools

This commit is contained in:
Mario Zechner
2026-05-23 09:48:51 +02:00
parent 9b62f1f87c
commit e9146a5ff7
17 changed files with 706 additions and 398 deletions

View File

@@ -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"),
};
}