diff --git a/tck/sut_agent.py b/tck/sut_agent.py index 0ca3a1450..206774c64 100644 --- a/tck/sut_agent.py +++ b/tck/sut_agent.py @@ -14,6 +14,7 @@ import a2a.types.a2a_pb2_grpc as a2a_grpc from a2a.compat.v0_3.grpc_handler import CompatGrpcHandler +from a2a.helpers.proto_helpers import new_task_from_user_message from a2a.server.agent_execution.agent_executor import AgentExecutor from a2a.server.agent_execution.context import RequestContext from a2a.server.events.event_queue import EventQueue @@ -87,6 +88,13 @@ async def execute( self.running_tasks.add(task_id) + # 1.0 semantics: the Task itself must be enqueued before any + # TaskStatusUpdateEvent (the SDK enforces this ordering). + task = context.current_task + if not task: + task = new_task_from_user_message(user_message) + await event_queue.enqueue_event(task) + logger.info( '[SUTAgentExecutor] Processing message %s for task %s (context: %s)', user_message.message_id, @@ -157,11 +165,11 @@ def serve(task_store: TaskStore) -> None: ), AgentInterface( url=f'http://localhost:{http_port}{REST_URL}', - protocol_binding='REST', + protocol_binding='HTTP+JSON', protocol_version='1.0.0', ), AgentInterface( - url=f'http://localhost:{grpc_port}', + url=f'localhost:{grpc_port}', protocol_binding='GRPC', protocol_version='1.0.0', ),