Skip to content

Commit a5509e6

Browse files
lukehindsmindpower
andauthored
fix: Fixes Short Circuit clause for context ID (#236)
If #235 is an issue, this should fix. If its as intended, apologies for the noise and feel free to close Fixes #235 🦕 Co-authored-by: Junjie Bu <jbu@google.com>
1 parent e106020 commit a5509e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/a2a/server/tasks/task_manager.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ async def save_task_event(
107107
)
108108
if not self.task_id:
109109
self.task_id = task_id_from_event
110-
if not self.context_id and self.context_id != event.contextId:
110+
if self.context_id and self.context_id != event.contextId:
111+
raise ServerError(
112+
error=InvalidParamsError(
113+
message=f"Context in event doesn't match TaskManager {self.context_id} : {event.contextId}"
114+
)
115+
)
116+
if not self.context_id:
111117
self.context_id = event.contextId
112118

113119
logger.debug(

0 commit comments

Comments
 (0)