fix: use background context for dispatcher to avoid creating visible chat

linuztx committed Mar 16, 2026 at 13:56 UTC d7bf56164844b2fa13eb4594283a7193904d5e56
1 file changed +3 -2
plugins/_email_integration/helpers/handler.py
+3 -2
@@ -9,7 +9,7 @@ import base64
9 import json
10 import os
11
12 -from agent import Agent, AgentContext, UserMessage
12 +from agent import Agent, AgentContext, AgentContextType, UserMessage
13 from helpers import guids, plugins, files, runtime
14 from helpers import message_queue as mq
15 from helpers.notification import NotificationManager, NotificationType, NotificationPriority
@@ -128,7 +128,8 @@ async def _dispatch_all(handler_cfg: dict, messages: list[InboundMessage]):
128 ctx = AgentContext.first()
129 if not ctx:
130 agent_config = initialize_agent()
131 - ctx = AgentContext(agent_config, name="Email Dispatcher")
131 + ctx = AgentContext(agent_config, name="Email Dispatcher",
132 + type=AgentContextType.BACKGROUND)
133 agent = ctx.agent0
134
135 for msg in messages: