From f0c83afeefb36cb01305bf5b6eb8522667cb410f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 20:09:53 +0000 Subject: [PATCH 1/7] chore(deps): Update a2a-sdk requirement in /a2a/a2a_currency_converter Updates the requirements on [a2a-sdk](https://github.com/a2aproject/a2a-python) to permit the latest version. - [Release notes](https://github.com/a2aproject/a2a-python/releases) - [Changelog](https://github.com/a2aproject/a2a-python/blob/main/CHANGELOG.md) - [Commits](https://github.com/a2aproject/a2a-python/compare/v0.2.5...v0.3.25) --- updated-dependencies: - dependency-name: a2a-sdk dependency-version: 0.3.25 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- a2a/a2a_currency_converter/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a2a/a2a_currency_converter/pyproject.toml b/a2a/a2a_currency_converter/pyproject.toml index a686c439..fc1b575b 100644 --- a/a2a/a2a_currency_converter/pyproject.toml +++ b/a2a/a2a_currency_converter/pyproject.toml @@ -5,7 +5,7 @@ description = "Sample LangGraph currency agent with A2A Protocol" readme = "README.md" requires-python = ">=3.12" dependencies = [ - "a2a-sdk>=0.2.5,<0.3.0", + "a2a-sdk>=0.2.5,<0.4.0", "click>=8.1.8", "httpx>=0.28.1", "langchain-google-genai>=2.0.10", From 90164ab8c16b39e2679243ae6ad0bb25159dd8e3 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:02:47 -0400 Subject: [PATCH 2/7] fix(a2a): migrate currency converter to a2a-sdk 0.3.x API Migrate camelCase fields to snake_case and remove manual agent-card route workaround (now built into SDK >= 0.3.0): - AgentCapabilities: pushNotifications -> push_notifications - AgentCard: defaultInputModes/defaultOutputModes -> snake_case - Remove manual /.well-known/agent-card.json route insertion - task.contextId -> task.context_id in agent_executor.py Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/app/__main__.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/a2a/a2a_currency_converter/app/__main__.py b/a2a/a2a_currency_converter/app/__main__.py index 9a3403fe..1a2f9fa3 100644 --- a/a2a/a2a_currency_converter/app/__main__.py +++ b/a2a/a2a_currency_converter/app/__main__.py @@ -6,7 +6,6 @@ import httpx import uvicorn from dotenv import load_dotenv -from starlette.routing import Route from a2a.server.apps import A2AStarletteApplication from a2a.server.request_handlers import DefaultRequestHandler @@ -37,7 +36,7 @@ def main(host, port): try: # We don't check OPENAI_API_KEY here. We want the agent pod to run even if OPENAI_API_KEY isn't defined. - capabilities = AgentCapabilities(streaming=True, pushNotifications=True) + capabilities = AgentCapabilities(streaming=True, push_notifications=True) skill = AgentSkill( id="convert_currency", name="Currency Exchange Rates Tool", @@ -51,8 +50,8 @@ def main(host, port): # Allow env var AGENT_ENDPOINT to override the URL in the agent card url=os.getenv("AGENT_ENDPOINT", f"http://{host}:{port}/"), version="1.0.0", - defaultInputModes=CurrencyAgent.SUPPORTED_CONTENT_TYPES, - defaultOutputModes=CurrencyAgent.SUPPORTED_CONTENT_TYPES, + default_input_modes=CurrencyAgent.SUPPORTED_CONTENT_TYPES, + default_output_modes=CurrencyAgent.SUPPORTED_CONTENT_TYPES, capabilities=capabilities, skills=[skill], ) @@ -68,17 +67,6 @@ def main(host, port): app = server.build() - # Add the new agent-card.json path alongside the legacy agent.json path - app.routes.insert( - 0, - Route( - "/.well-known/agent-card.json", - server._handle_get_agent_card, - methods=["GET"], - name="agent_card_new", - ), - ) - uvicorn.run(app, host=host, port=port) # --8<-- [end:DefaultRequestHandler] From f21b89e69ea88311726efaa844ac1b39f2daef72 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:02:54 -0400 Subject: [PATCH 3/7] fix(a2a): migrate task.contextId to task.context_id Update all task.contextId attribute accesses to task.context_id to comply with a2a-sdk 0.3.x API (camelCase access removed). Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/app/agent_executor.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/a2a/a2a_currency_converter/app/agent_executor.py b/a2a/a2a_currency_converter/app/agent_executor.py index 999477b8..46660bf4 100644 --- a/a2a/a2a_currency_converter/app/agent_executor.py +++ b/a2a/a2a_currency_converter/app/agent_executor.py @@ -52,9 +52,9 @@ async def execute( task = new_task(context.message) logger.info(f"Created task for message : {context.message}") event_queue.enqueue_event(task) - updater = TaskUpdater(event_queue, task.id, task.contextId) + updater = TaskUpdater(event_queue, task.id, task.context_id) try: - async for item in self.agent.stream(query, task.contextId): + async for item in self.agent.stream(query, task.context_id): is_task_complete = item["is_task_complete"] require_user_input = item["require_user_input"] @@ -64,7 +64,7 @@ async def execute( TaskState.working, new_agent_text_message( item["content"], - task.contextId, + task.context_id, task.id, ), ) @@ -74,7 +74,7 @@ async def execute( TaskState.input_required, new_agent_text_message( item["content"], - task.contextId, + task.context_id, task.id, ), final=True, @@ -104,7 +104,7 @@ async def execute( TaskState.input_required, new_agent_text_message( msg, - task.contextId, + task.context_id, task.id, ), final=True, @@ -119,7 +119,7 @@ async def execute( Use `kubectl -n logs deployment/` for details. Also check -`kubectl -n get secret openai-secret -o jsonpath="{"{"}.data.apikey{"}"}" | base64 -d` +`kubectl -n get secret openai-secret -o jsonpath="{"{"}}.data.apikey{"}"}" | base64 -d` The key should match your OpenAI key.""" logger.error(msg=msg) logger.error(msg=f"Raw AuthenticationError {e}") @@ -127,7 +127,7 @@ async def execute( TaskState.input_required, new_agent_text_message( msg, - task.contextId, + task.context_id, task.id, ), final=True, @@ -142,7 +142,7 @@ async def execute( # We don't show the error to the user, as it may have credentials """Internal error on the agent. Use `kubectl -n logs deployment/` for details""", - task.contextId, + task.context_id, task.id, ), final=True, From 7632c71fbd1860c62b183dbe3716c1b1fedf5185 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:05:08 -0400 Subject: [PATCH 4/7] fix(a2a): migrate InMemoryPushNotifier to 0.3.x push notification API InMemoryPushNotifier was removed in a2a-sdk 0.3.0. Replace with InMemoryPushNotificationConfigStore + BasePushNotificationSender. Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/app/__main__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/a2a/a2a_currency_converter/app/__main__.py b/a2a/a2a_currency_converter/app/__main__.py index 1a2f9fa3..1981b5dc 100644 --- a/a2a/a2a_currency_converter/app/__main__.py +++ b/a2a/a2a_currency_converter/app/__main__.py @@ -9,7 +9,11 @@ from a2a.server.apps import A2AStarletteApplication from a2a.server.request_handlers import DefaultRequestHandler -from a2a.server.tasks import InMemoryPushNotifier, InMemoryTaskStore +from a2a.server.tasks import ( + BasePushNotificationSender, + InMemoryPushNotificationConfigStore, + InMemoryTaskStore, +) from a2a.types import ( AgentCapabilities, AgentCard, @@ -58,10 +62,12 @@ def main(host, port): # --8<-- [start:DefaultRequestHandler] httpx_client = httpx.AsyncClient() + push_config_store = InMemoryPushNotificationConfigStore() request_handler = DefaultRequestHandler( agent_executor=CurrencyAgentExecutor(), task_store=InMemoryTaskStore(), - push_notifier=InMemoryPushNotifier(httpx_client), + push_config_store=push_config_store, + push_sender=BasePushNotificationSender(httpx_client, push_config_store), ) server = A2AStarletteApplication(agent_card=agent_card, http_handler=request_handler) From 6c501e48f11ab00efb4e457fd26a7cef66e278a7 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:06:09 -0400 Subject: [PATCH 5/7] fix(a2a): migrate task.contextId to task.context_id Update all task.contextId attribute accesses to task.context_id to comply with a2a-sdk 0.3.x API (camelCase access removed). Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/app/agent_executor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/a2a/a2a_currency_converter/app/agent_executor.py b/a2a/a2a_currency_converter/app/agent_executor.py index 46660bf4..377d9372 100644 --- a/a2a/a2a_currency_converter/app/agent_executor.py +++ b/a2a/a2a_currency_converter/app/agent_executor.py @@ -119,7 +119,7 @@ async def execute( Use `kubectl -n logs deployment/` for details. Also check -`kubectl -n get secret openai-secret -o jsonpath="{"{"}}.data.apikey{"}"}" | base64 -d` +`kubectl -n get secret openai-secret -o jsonpath="{"{"}.data.apikey{"}"}" | base64 -d` The key should match your OpenAI key.""" logger.error(msg=msg) logger.error(msg=f"Raw AuthenticationError {e}") @@ -154,3 +154,4 @@ def _validate_request(self, _: RequestContext) -> bool: async def cancel(self, _: RequestContext, event_queue: EventQueue) -> Task | None: raise ServerError(error=UnsupportedOperationError()) + From 154f30754ff3a6fb99879764b044a5995f470e41 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:06:42 -0400 Subject: [PATCH 6/7] fix(a2a): use a2a-sdk[http-server] extra for 0.3.x compatibility In a2a-sdk 0.3.x, starlette and sse-starlette became optional dependencies under the [http-server] extra. Update the dependency specifier accordingly. Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a2a/a2a_currency_converter/pyproject.toml b/a2a/a2a_currency_converter/pyproject.toml index fc1b575b..51aad164 100644 --- a/a2a/a2a_currency_converter/pyproject.toml +++ b/a2a/a2a_currency_converter/pyproject.toml @@ -5,7 +5,7 @@ description = "Sample LangGraph currency agent with A2A Protocol" readme = "README.md" requires-python = ">=3.12" dependencies = [ - "a2a-sdk>=0.2.5,<0.4.0", + "a2a-sdk[http-server]>=0.2.5,<0.4.0", "click>=8.1.8", "httpx>=0.28.1", "langchain-google-genai>=2.0.10", From b1f3d5daca876e672a34a0ed45c826ca45976a18 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Thu, 12 Mar 2026 18:10:03 -0400 Subject: [PATCH 7/7] style: apply ruff formatting to agent_executor.py Signed-off-by: Paolo Dettori --- a2a/a2a_currency_converter/app/agent_executor.py | 1 - 1 file changed, 1 deletion(-) diff --git a/a2a/a2a_currency_converter/app/agent_executor.py b/a2a/a2a_currency_converter/app/agent_executor.py index 377d9372..6f6332ad 100644 --- a/a2a/a2a_currency_converter/app/agent_executor.py +++ b/a2a/a2a_currency_converter/app/agent_executor.py @@ -154,4 +154,3 @@ def _validate_request(self, _: RequestContext) -> bool: async def cancel(self, _: RequestContext, event_queue: EventQueue) -> Task | None: raise ServerError(error=UnsupportedOperationError()) -