From a96387d54767d0c128974aa9ea3adb603526f972 Mon Sep 17 00:00:00 2001 From: "dipi.evil" Date: Fri, 19 Dec 2025 11:17:29 -0300 Subject: [PATCH] fix: validate existing agent for context --- python/api/api_message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/api/api_message.py b/python/api/api_message.py index de0859387..8eb5b53ef 100644 --- a/python/api/api_message.py +++ b/python/api/api_message.py @@ -76,7 +76,9 @@ class ApiMessage(ApiHandler): # Get or create context if context_id: - context = AgentContext.use(context_id) + if agent_profile: + return Response('{"error": "Cannot override agent profile on existing context"}', status=400, mimetype="application/json") + context = AgentContext.use(context_id) if not context: return Response('{"error": "Context not found"}', status=404, mimetype="application/json") else: