fix: change a2a context type to BACKGROUND
Rafael Uzarowski committed
Aug 1, 2025 at 09:02 UTC
5e3b30465af9fd3337d19a2f350fb44b50de76f4
3 files changed
+5
-5
agent.py
+1
-1
@@ -29,7 +29,7 @@ from python.helpers.extension import call_extensions
29
class AgentContextType(Enum):
30
USER = "user"
31
TASK = "task"
32
- MCP = "mcp"
32
+ BACKGROUND = "background"
33
34
35
class AgentContext:
python/helpers/fasta2a_server.py
+2
-2
@@ -11,7 +11,7 @@ from starlette.requests import Request
11
12
# Local imports
13
from python.helpers.print_style import PrintStyle
14
-from agent import AgentContext, UserMessage
14
+from agent import AgentContext, UserMessage, AgentContextType
15
from initialize import initialize_agent
16
17
# Import FastA2A
@@ -84,7 +84,7 @@ class AgentZeroWorker(Worker): # type: ignore[misc]
84
if not context:
85
# Create new context for this A2A conversation
86
cfg = initialize_agent()
87
- context = AgentContext(cfg, id=context_id)
87
+ context = AgentContext(cfg, id=context_id, type=AgentContextType.BACKGROUND)
88
89
# Log user message so it appears instantly in UI chat window
90
context.log.log(
python/helpers/mcp_server.py
+2
-2
@@ -140,7 +140,7 @@ async def send_message(
140
persistent_chat = True
141
else:
142
config = initialize_agent()
143
- context = AgentContext(config=config, type=AgentContextType.MCP)
143
+ context = AgentContext(config=config, type=AgentContextType.BACKGROUND)
144
145
if not message:
146
return ToolError(
@@ -326,4 +326,4 @@ async def mcp_middleware(request: Request, call_next):
326
status_code=403, detail="MCP server is disabled in settings."
327
)
328
329
- return await call_next(request)
\ No newline at end of file
329
+ return await call_next(request)