From 4dd2c8f901ab46f76724944256f60cb1867a7d24 Mon Sep 17 00:00:00 2001 From: Venkatesh Subramaniyan Date: Fri, 17 Apr 2026 18:22:41 -0400 Subject: [PATCH] feat(a2a): wire artifact delivery interceptor in fast_api A2A setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass include_artifacts_in_a2a_event_interceptor as default interceptor when constructing A2aAgentExecutor in fast_api.py. Previously the interceptor existed (added in e63d991) but was never wired — A2aAgentExecutor was created with no config so execute_interceptors defaulted to None and artifact_delta was silently dropped on the A2A path. Non-breaking: interceptor is no-op when artifact_delta is empty or artifact_service is None. Fixes #5379 Relates to #3630 --- src/google/adk/a2a/executor/config.py | 1 + src/google/adk/cli/fast_api.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/google/adk/a2a/executor/config.py b/src/google/adk/a2a/executor/config.py index 0bb639f329..3343fe61a9 100644 --- a/src/google/adk/a2a/executor/config.py +++ b/src/google/adk/a2a/executor/config.py @@ -41,6 +41,7 @@ from .executor_context import ExecutorContext + @dataclasses.dataclass class ExecuteInterceptor: """Interceptor for the A2aAgentExecutor.""" diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index 199791f7da..7a6744d2cb 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -587,6 +587,10 @@ async def get_agent_builder( from a2a.utils.constants import AGENT_CARD_WELL_KNOWN_PATH from ..a2a.executor.a2a_agent_executor import A2aAgentExecutor + from ..a2a.executor.config import A2aAgentExecutorConfig + from ..a2a.executor.interceptors.include_artifacts_in_a2a_event import ( + include_artifacts_in_a2a_event_interceptor, + ) # locate all a2a agent apps in the agents directory base_path = Path.cwd() / agents_dir @@ -618,6 +622,9 @@ async def _get_a2a_runner_async() -> Runner: try: agent_executor = A2aAgentExecutor( runner=create_a2a_runner_loader(app_name), + config=A2aAgentExecutorConfig( + execute_interceptors=[include_artifacts_in_a2a_event_interceptor], + ), ) push_config_store = InMemoryPushNotificationConfigStore()