74
case MessageAttachmentKind.EmbeddedResource: {
75
if (att.contentType.startsWith('image/')) {
77
>
const tmp = join(os.tmpdir(), `codex-img-${crypto.randomBytes(8).toString('hex')}${ext}`);
78
>
try {
79
>
fs.writeFileSync(tmp, Buffer.from(att.data, 'base64'));
80
>
cleanupPaths.push(tmp);
81
>
input.push({ type: 'localImage', path: tmp });
82
>
} catch {
83
// If writing the temp file fails, drop the
84
// attachment silently — better to send the prompt
85
// without the image than to fail the whole turn.
86
}
88
>
}
89
if (isTextualContentType(att.contentType)) {
90
// The client inlines the live text of an unsaved / dirty