Skip to content

Agent Zero AI framework

fix(email): reference attachments before text parts and remove unused import

linuztx820928260c58
diff --git a/plugins/_email_integration/helpers/handler.py b/plugins/_email_integration/helpers/handler.py
index cef388074..ef194f3fd 100644
--- a/plugins/_email_integration/helpers/handler.py
+++ b/plugins/_email_integration/helpers/handler.py
@@ -12,7 +12,6 @@ import os
from agent import Agent, AgentContext, AgentContextType, UserMessage
from helpers import guids, plugins, files, runtime
from helpers import message_queue as mq
-from helpers.notification import NotificationManager, NotificationType, NotificationPriority
from helpers.persist_chat import save_tmp_chat
from helpers.print_style import PrintStyle
from helpers.errors import format_error
diff --git a/plugins/_email_integration/helpers/imap_client.py b/plugins/_email_integration/helpers/imap_client.py
index d90fb39ff..f88456d7a 100644
--- a/plugins/_email_integration/helpers/imap_client.py
+++ b/plugins/_email_integration/helpers/imap_client.py
@@ -343,7 +343,7 @@ async def _parse_body(
if cid:
cid_map[cid.strip("<>")] = path
- if not cid and body_parts:
+ if not cid:
body_parts.append(f"\n[attachment://{path}]\n")
elif content_type == "text/plain":