fix(coding-agent): detect image MIME via file-type (#205)

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
Peter Steinberger 2025-12-17 17:11:56 +01:00 committed by GitHub
parent 46ba48a35d
commit d70edf571e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 191 additions and 50 deletions

View file

@ -115,15 +115,15 @@ async function runInteractiveMode(
}
/** Prepare initial message from @file arguments */
function prepareInitialMessage(parsed: Args): {
async function prepareInitialMessage(parsed: Args): Promise<{
initialMessage?: string;
initialAttachments?: Attachment[];
} {
}> {
if (parsed.fileArgs.length === 0) {
return {};
}
const { textContent, imageAttachments } = processFileArguments(parsed.fileArgs);
const { textContent, imageAttachments } = await processFileArguments(parsed.fileArgs);
// Combine file content with first plain text message (if any)
let initialMessage: string;
@ -181,7 +181,7 @@ export async function main(args: string[]) {
}
// Process @file arguments
const { initialMessage, initialAttachments } = prepareInitialMessage(parsed);
const { initialMessage, initialAttachments } = await prepareInitialMessage(parsed);
// Determine if we're in interactive mode (needed for theme watcher)
const isInteractive = !parsed.print && parsed.mode === undefined;