From 7d7d5995e0cdf2c97c2e842caca6928a0297b1c5 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Wed, 15 Apr 2026 11:18:52 -0700 Subject: [PATCH] =?UTF-8?q?fix(workspace-template):=20#204=20=E2=80=94=20d?= =?UTF-8?q?rop=20PushNotificationSender=20(abstract=20class)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #204. PR #198 wired push_sender=PushNotificationSender() into DefaultRequestHandler to satisfy #175's push-notification capability, but PushNotificationSender in a2a-sdk is an abstract base class and cannot be instantiated. Every workspace container crashed on startup with TypeError. Reverted to DefaultRequestHandler's defaults. The pushNotifications capability still appears in AgentCard.capabilities (advertised to A2A clients) but actual implementation of the sender is deferred to a Phase-H follow-up that subclasses PushNotificationSender properly. Existing pytest suite unchanged (the crash was only at runtime on main.py import, which no existing test exercises directly). Co-Authored-By: Claude Opus 4.6 (1M context) --- workspace-template/main.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/workspace-template/main.py b/workspace-template/main.py index d54e7bb3..c8e5b7d6 100644 --- a/workspace-template/main.py +++ b/workspace-template/main.py @@ -12,7 +12,7 @@ import httpx import uvicorn from a2a.server.apps import A2AStarletteApplication from a2a.server.request_handlers import DefaultRequestHandler -from a2a.server.tasks import InMemoryTaskStore, InMemoryPushNotificationConfigStore, PushNotificationSender +from a2a.server.tasks import InMemoryTaskStore from a2a.types import AgentCard, AgentCapabilities, AgentSkill from adapters import get_adapter, AdapterConfig @@ -152,12 +152,20 @@ async def main(): # pragma: no cover defaultOutputModes=["text/plain", "application/json"], ) - # 7. Wrap in A2A + # 7. Wrap in A2A. + # + # Regression fix (#204): PR #198 tried to wire push_config_store + + # push_sender to satisfy #175 (push notification capability), but + # PushNotificationSender is an abstract base class in the a2a-sdk and + # can't be instantiated directly. Passing it crashed main.py on startup + # with `TypeError: Can't instantiate abstract class`. Dropped back to + # DefaultRequestHandler's own defaults — pushNotifications capability + # in the AgentCard below is still advertised via AgentCapabilities so + # clients know we COULD do pushes; actually implementing them requires + # a concrete sender subclass, tracked as a Phase-H follow-up to #175. handler = DefaultRequestHandler( agent_executor=executor, task_store=InMemoryTaskStore(), - push_config_store=InMemoryPushNotificationConfigStore(), - push_sender=PushNotificationSender(), ) app = A2AStarletteApplication(