@@ -109,7 +109,7 @@ async def on_get_task(
109109 context : ServerCallContext | None = None ,
110110 ) -> Task | None :
111111 """Default handler for 'tasks/get'."""
112- task : Task | None = await self .task_store .get (params .id )
112+ task : Task | None = await self .task_store .get (params .id , context )
113113 if not task :
114114 raise ServerError (error = TaskNotFoundError ())
115115
@@ -141,7 +141,7 @@ async def on_cancel_task(
141141
142142 Attempts to cancel the task managed by the `AgentExecutor`.
143143 """
144- task : Task | None = await self .task_store .get (params .id )
144+ task : Task | None = await self .task_store .get (params .id , context )
145145 if not task :
146146 raise ServerError (error = TaskNotFoundError ())
147147
@@ -158,6 +158,7 @@ async def on_cancel_task(
158158 context_id = task .context_id ,
159159 task_store = self .task_store ,
160160 initial_message = None ,
161+ context = context ,
161162 )
162163 result_aggregator = ResultAggregator (task_manager )
163164
@@ -224,6 +225,7 @@ async def _setup_message_execution(
224225 context_id = params .message .context_id ,
225226 task_store = self .task_store ,
226227 initial_message = params .message ,
228+ context = context ,
227229 )
228230 task : Task | None = await task_manager .get_task ()
229231
@@ -424,7 +426,7 @@ async def on_set_task_push_notification_config(
424426 if not self ._push_config_store :
425427 raise ServerError (error = UnsupportedOperationError ())
426428
427- task : Task | None = await self .task_store .get (params .task_id )
429+ task : Task | None = await self .task_store .get (params .task_id , context )
428430 if not task :
429431 raise ServerError (error = TaskNotFoundError ())
430432
@@ -447,7 +449,7 @@ async def on_get_task_push_notification_config(
447449 if not self ._push_config_store :
448450 raise ServerError (error = UnsupportedOperationError ())
449451
450- task : Task | None = await self .task_store .get (params .id )
452+ task : Task | None = await self .task_store .get (params .id , context )
451453 if not task :
452454 raise ServerError (error = TaskNotFoundError ())
453455
@@ -476,7 +478,7 @@ async def on_resubscribe_to_task(
476478 Allows a client to re-attach to a running streaming task's event stream.
477479 Requires the task and its queue to still be active.
478480 """
479- task : Task | None = await self .task_store .get (params .id )
481+ task : Task | None = await self .task_store .get (params .id , context )
480482 if not task :
481483 raise ServerError (error = TaskNotFoundError ())
482484
@@ -492,6 +494,7 @@ async def on_resubscribe_to_task(
492494 context_id = task .context_id ,
493495 task_store = self .task_store ,
494496 initial_message = None ,
497+ context = context ,
495498 )
496499
497500 result_aggregator = ResultAggregator (task_manager )
@@ -516,7 +519,7 @@ async def on_list_task_push_notification_config(
516519 if not self ._push_config_store :
517520 raise ServerError (error = UnsupportedOperationError ())
518521
519- task : Task | None = await self .task_store .get (params .id )
522+ task : Task | None = await self .task_store .get (params .id , context )
520523 if not task :
521524 raise ServerError (error = TaskNotFoundError ())
522525
@@ -543,7 +546,7 @@ async def on_delete_task_push_notification_config(
543546 if not self ._push_config_store :
544547 raise ServerError (error = UnsupportedOperationError ())
545548
546- task : Task | None = await self .task_store .get (params .id )
549+ task : Task | None = await self .task_store .get (params .id , context )
547550 if not task :
548551 raise ServerError (error = TaskNotFoundError ())
549552
0 commit comments