Skip to content

feat: Keep only 0.3 compatible endpoints in compat version of AgentCard #846

Closed
bartek-w wants to merge 1 commit into1.0-devfrom
bartekw-agent-card-v03
Closed

feat: Keep only 0.3 compatible endpoints in compat version of AgentCard #846
bartek-w wants to merge 1 commit into1.0-devfrom
bartekw-agent-card-v03

Conversation

@bartek-w
Copy link
Copy Markdown
Collaborator

Fixes #742

@bartek-w bartek-w changed the base branch from main to 1.0-dev March 17, 2026 11:33
@bartek-w bartek-w changed the title Keep only 0.3 compatible endpoints in compat version of AgentCard feat: Keep only 0.3 compatible endpoints in compat version of AgentCard Mar 17, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the A2A SDK's ability to interoperate with different protocol versions, particularly focusing on backward compatibility with v0.3 endpoints. It transitions the core data structures to Protocol Buffers for improved robustness and introduces a robust database migration system. The changes ensure that both client and server components can gracefully handle requests from various protocol versions, laying the groundwork for future extensibility and stability.

Highlights

  • Backward Compatibility: Introduced comprehensive backward compatibility layers for A2A v0.3 protocol, enabling seamless interaction with older clients and servers while transitioning to v1.0.
  • Protocol Buffer Migration: Migrated the SDK's core types from Pydantic models to Protocol Buffers (v1.0), enhancing type safety, performance, and cross-language compatibility. Legacy v0.3 Pydantic models are now used for compatibility conversions.
  • Client and Server Refactoring: Performed extensive refactoring of client-side interceptors and server-side request handlers to support the new Protocol Buffer-based types and improve error handling mechanisms.
  • Database Migrations: Integrated Alembic for database schema management, adding new columns (owner, last_updated, protocol_version) and indices to task and push notification configuration tables to support multi-tenancy and versioning.
  • Build and Linting Scripts: Updated and added new build scripts (gen_proto.sh, gen_proto_compat.sh) for protobuf generation and introduced a local linting script (lint.sh) for consistent code quality.
Changelog
  • .git-blame-ignore-revs
    • Updated the template URL from 'master' to 'main' branch.
  • .github/actions/spelling/allow.txt
    • Added new words ('a2a', 'A2A', 'A2AFastAPI', 'AException', 'AIP', 'alg', 'base64url', 'buf', 'bufbuild', 'ES256', 'FastAPI', 'hazmat', 'HS256', 'HS384', 'importlib', 'jcs', 'JOSE', 'JSONRPC', 'middleware', 'npx', 'Oneof', 'OpenAPI', 'openapiv', 'openapiv2', 'pb2', 'poolclass', 'proto', 'protobuf', 'Protobuf', 'pydantic', 'RS256', 'SECP256R1', 'starlette', 'Starlette', 'swagger', 'typ', 'TResponse') to the allowed list for spelling checks.
  • .github/actions/spelling/excludes.txt
    • Added new exclude patterns for spelling checks, including 'buf.gen.yaml', 'src/a2a/types/', 'src/a2a/compat/v0_3/a2a_v0_3*', and 'a2a.json'.
  • .gitignore
    • Added 'docker-compose.yaml' and '.geminiignore' to the ignore list.
  • .jscpd.json
    • Added '/src/a2a/compat/' to the ignore list for code duplication checks.
  • .release-please-manifest.json
    • Added a new file for release management configuration.
  • CODE_OF_CONDUCT.md
    • Updated the link to the Google New Project repository from 'master' to 'main' branch.
  • buf.compat.gen.yaml
    • Added a new configuration file for generating legacy v0.3 A2A protocol buffer modules.
  • buf.gen.yaml
    • Updated the Git repository reference to 'v1.0.0' and changed the subdirectory to 'specification'.
    • Changed the output directory for generated Python protobuf files from 'src/a2a/grpc' to 'src/a2a/types'.
    • Added a new plugin to generate 'a2a.swagger.json' (OpenAPI v2) to 'src/a2a/types'.
  • pyproject.toml
    • Added 'json-rpc' and 'googleapis-common-protos' to project dependencies.
    • Updated the 'grpc' optional dependency to include 'grpcio-status'.
    • Added 'db-cli' optional dependency for 'alembic'.
    • Added 'pyright' to development dependencies.
    • Removed 'datamodel-code-generator' from development dependencies.
    • Added filter warnings for SQLAlchemy and asyncio resource warnings.
    • Added Alembic configuration for migration scripts and system path.
    • Added 'a2a-db' script entry point for database migrations.
    • Updated 'mypy' and 'ruff' exclude patterns to include new 'src/a2a/types' and 'src/a2a/compat' paths.
  • scripts/checkout_experimental_types.sh
    • Removed the script for checking out experimental types.
  • scripts/gen_proto.sh
    • Added a new script for generating protobuf code and OpenAPI spec, including renaming the generated Swagger JSON and fixing imports in gRPC files.
    • Added logic to download legacy v0.3 proto file for compatibility.
  • scripts/gen_proto_compat.sh
    • Added a new script for generating legacy v0.3 compatibility protobuf code and fixing imports.
  • scripts/generate_types.sh
    • Removed the script for generating types.
  • scripts/grpc_gen_post_processor.py
    • Removed the gRPC generation post-processor script.
  • scripts/lint.sh
    • Added a new script for local linting and formatting using Ruff, MyPy, and Pyright.
  • src/a2a/a2a_db_cli.py
    • Added a new CLI tool for managing A2A database migrations using Alembic.
  • src/a2a/alembic.ini
    • Added the Alembic configuration file for database migrations.
  • src/a2a/client/init.py
    • Updated imports to reflect the new client structure, including ClientCallContext and ClientCallInterceptor from new modules.
    • Removed references to deprecated A2AClient, A2AClientHTTPError, A2AClientJSONError, and A2AGrpcClient.
  • src/a2a/client/auth/credentials.py
    • Updated the import path for ClientCallContext.
  • src/a2a/client/auth/interceptor.py
    • Updated imports to use new BeforeArgs, AfterArgs, and ClientCallInterceptor from interceptors module.
    • Refactored intercept method to before and added after method, adapting to new protobuf types for security scheme handling.
  • src/a2a/client/base_client.py
    • Updated imports to use new protobuf types and ClientCallContext from client module.
    • Removed Self import and __aenter__/__aexit__ methods, as they are now handled in the base Client class.
    • Refactored send_message to use SendMessageRequest and StreamResponse and implemented _apply_client_config for client configuration.
    • Updated get_task, cancel_task, create_task_push_notification_config, get_task_push_notification_config, subscribe, and get_extended_agent_card to use new protobuf request types and interceptor execution logic.
    • Added list_tasks, list_task_push_notification_configs, and delete_task_push_notification_config methods.
  • src/a2a/client/card_resolver.py
    • Updated imports to use new protobuf types and AgentCardResolutionError.
    • Refactored error handling to use AgentCardResolutionError instead of A2AClientHTTPError and A2AClientJSONError.
    • Updated get_agent_card to use parse_agent_card helper for backward compatibility.
  • src/a2a/client/client.py
    • Updated imports to use new protobuf types and ClientCallContext from client module.
    • Refactored ClientConfig to use supported_protocol_bindings instead of supported_transports and removed extensions field.
    • Defined ClientCallContext as a Pydantic model with state, timeout, and service_parameters.
    • Updated ClientEvent definition to use StreamResponse.
    • Added __aenter__ and __aexit__ methods for async context management.
    • Updated abstract methods to use new protobuf request types for all client operations.
  • src/a2a/client/client_factory.py
    • Updated imports to use new protobuf types and ClientCallInterceptor from interceptors module.
    • Refactored _register_defaults to dynamically create transport producers based on protocol version, supporting legacy v0.3 transports.
    • Added _find_best_interface static method for protocol version negotiation.
    • Removed extensions parameter from connect and create methods.
    • Introduced TenantTransportDecorator for tenant-aware routing.
    • Updated minimal_agent_card to use supported_interfaces and extended_agent_card capability.
  • src/a2a/client/client_task_manager.py
    • Updated imports to use new protobuf types and simplified error handling with A2AClientError.
    • Refactored process method to handle StreamResponse directly and update task state accordingly.
    • Updated update_with_message to use protobuf field presence checks and MergeFrom.
  • src/a2a/client/errors.py
    • Simplified error hierarchy, removing A2AClientHTTPError, A2AClientJSONError, A2AClientInvalidArgsError, A2AClientInvalidStateError, and A2AClientJSONRPCError.
    • Introduced AgentCardResolutionError for agent card resolution failures.
  • src/a2a/client/helpers.py
    • Added parse_agent_card and helper functions (_handle_extended_card_compatibility, _handle_connection_fields_compatibility, _map_legacy_security, _handle_security_compatibility) for backward compatibility of AgentCard fields.
    • Updated create_text_message_object to use new Role enum.
  • src/a2a/client/interceptors.py
    • Added a new file defining BeforeArgs, AfterArgs, and ClientCallInterceptor for client-side request/response interception.
  • src/a2a/client/legacy.py
    • Removed the deprecated A2AClient for JSON-RPC backward compatibility.
  • src/a2a/client/legacy_grpc.py
    • Removed the deprecated A2AGrpcClient for gRPC backward compatibility.
  • src/a2a/client/middleware.py
    • Removed the middleware module, as interceptors are now handled by interceptors.py.
  • src/a2a/client/optionals.py
    • Updated the import for grpc.aio.Channel to ignore reportMissingModuleSource and changed dummy class to stub class.
  • src/a2a/client/service_parameters.py
    • Added a new file defining ServiceParameters and ServiceParametersFactory for managing service-specific parameters and extensions.
  • src/a2a/client/transports/base.py
    • Updated imports to use new protobuf types for all request and response objects.
    • Updated abstract methods to reflect the new protobuf request/response types and removed extensions parameters.
  • src/a2a/client/transports/grpc.py
    • Updated imports to use new protobuf types and error handling from grpc_status and google.rpc.
    • Added _map_grpc_error, _handle_grpc_exception, _handle_grpc_stream_exception for centralized gRPC error handling.
    • Refactored _get_grpc_metadata and _get_grpc_timeout to use ClientCallContext.
    • Added _call_grpc and _call_grpc_stream helper methods for consistent gRPC call execution.
    • Updated all service methods to use new protobuf request types and _call_grpc helpers.
  • src/a2a/client/transports/http_helpers.py
    • Added a new file with helper functions (handle_http_exceptions, get_http_args, send_http_request, send_http_stream_request) for common HTTP request handling and error management.
  • src/a2a/client/transports/jsonrpc.py
    • Updated imports to use new protobuf types, JSONRPC20Request, JSONRPC20Response, and http_helpers.
    • Removed custom interceptor logic, now handled by ClientCallInterceptor.
    • Refactored request/response serialization and error mapping to use protobuf and http_helpers.
    • Updated all service methods to use new protobuf request types and _send_request/_send_stream_request helpers.
  • src/a2a/client/transports/rest.py
    • Updated imports to use new protobuf types and http_helpers.
    • Refactored request/response serialization and error mapping to use protobuf and http_helpers.
    • Updated all service methods to use new protobuf request types and _execute_request/_send_stream_request helpers.
    • Implemented a retry mechanism for subscribe method to handle legacy GET requests.
  • src/a2a/client/transports/tenant_decorator.py
    • Added a new file defining TenantTransportDecorator to automatically inject tenant information into requests.
  • src/a2a/compat/init.py
    • Renamed from src/a2a/grpc/__init__.py to reflect its new role in compatibility.
  • src/a2a/compat/v0_3/README.md
    • Added a README file explaining the purpose and structure of the v0.3 compatibility layer.
  • src/a2a/compat/v0_3/a2a_v0_3.proto
    • Added the legacy v0.3 A2A protocol buffer definition file.
  • src/a2a/compat/v0_3/a2a_v0_3_pb2.py
    • Added the generated Python protobuf code for the v0.3 A2A protocol.
  • src/a2a/compat/v0_3/a2a_v0_3_pb2.pyi
    • Renamed from src/a2a/grpc/a2a_pb2.pyi to reflect its new role in v0.3 compatibility.
  • src/a2a/compat/v0_3/a2a_v0_3_pb2_grpc.py
    • Renamed from src/a2a/grpc/a2a_pb2_grpc.py to reflect its new role in v0.3 compatibility.
  • src/a2a/compat/v0_3/buf.lock
    • Added a new buf lock file for managing v0.3 compatibility protobuf dependencies.
  • src/a2a/compat/v0_3/buf.yaml
    • Added a new buf configuration file for v0.3 compatibility protobuf generation.
  • src/a2a/compat/v0_3/conversions.py
    • Added a new file containing functions for converting between v0.3 Pydantic models and v1.0 Protocol Buffer types.
  • src/a2a/compat/v0_3/grpc_handler.py
    • Added a new gRPC handler for backward compatibility with A2A v0.3 protocol, mapping v0.3 requests to v1.0 handlers.
  • src/a2a/compat/v0_3/grpc_transport.py
    • Added a new gRPC transport for backward compatibility with A2A v0.3 protocol, converting v1.0 requests to v0.3 format.
  • src/a2a/compat/v0_3/jsonrpc_adapter.py
    • Added a new JSON-RPC adapter for backward compatibility with A2A v0.3 protocol, mapping v0.3 requests to v1.0 handlers.
  • src/a2a/compat/v0_3/jsonrpc_transport.py
    • Added a new JSON-RPC transport for backward compatibility with A2A v0.3 protocol, converting v1.0 requests to v0.3 format.
  • src/a2a/compat/v0_3/proto_utils.py
    • Added a new file containing utilities for converting between v0.3 Pydantic models and v0.3 Protocol Buffer definitions.
  • src/a2a/compat/v0_3/rest_adapter.py
    • Added a new REST adapter for backward compatibility with A2A v0.3 protocol, mapping v0.3 requests to v1.0 handlers.
  • src/a2a/compat/v0_3/rest_handler.py
    • Added a new REST handler for backward compatibility with A2A v0.3 protocol, mapping v0.3 requests to v1.0 handlers.
  • src/a2a/compat/v0_3/rest_transport.py
    • Added a new REST transport for backward compatibility with A2A v0.3 protocol, converting v1.0 requests to v0.3 format.
  • src/a2a/compat/v0_3/types.py
    • Renamed from src/a2a/types.py to reflect its new role as v0.3 compatibility types.
  • src/a2a/compat/v0_3/versions.py
    • Added a new file with utility functions for protocol version comparison and validation.
  • src/a2a/contrib/tasks/vertex_task_converter.py
    • Updated imports for Artifact, DataPart, and FilePart to use a2a.compat.v0_3.types for compatibility.
  • src/a2a/contrib/tasks/vertex_task_store.py
    • Updated imports to use new protobuf types and v0.3 compatibility conversions.
    • Refactored _create and _update methods to work with CompatTask.
    • Updated get method to convert stored tasks to core protobuf types.
    • Added list method for retrieving tasks.
  • src/a2a/extensions/common.py
    • Removed the update_extension_header function.
  • src/a2a/grpc/a2a_pb2.py
    • Removed the generated Python protobuf code for the A2A protocol, as it's now located in src/a2a/types/a2a_pb2.py.
  • src/a2a/migrations/README.md
    • Added a README file explaining the A2A SDK database migration process using Alembic.
  • src/a2a/migrations/init.py
    • Added an __init__.py file for the Alembic database migration package.
  • src/a2a/migrations/env.py
    • Added the Alembic environment configuration file, including mandatory DATABASE_URL check and asynchronous migration support.
  • src/a2a/migrations/migration_utils.py
    • Added a new file with utility functions for Alembic migrations, including checks for table, column, and index existence, and helper functions for adding/dropping them.
  • src/a2a/migrations/script.py.mako
    • Added the Alembic migration script template.
  • src/a2a/migrations/versions/38ce57e08137_add_column_protocol_version.py
    • Added a new migration script to add a 'protocol_version' column to task and push notification configuration tables.
  • src/a2a/migrations/versions/6419d2d130f6_add_columns_owner_last_updated.py
    • Added a new migration script to add 'owner' and 'last_updated' columns and a composite index to task and push notification configuration tables.
  • src/a2a/migrations/versions/init.py
    • Added an __init__.py file for Alembic migration scripts.
  • src/a2a/server/agent_execution/agent_executor.py
    • Updated TaskState.canceled to TaskState.TASK_STATE_CANCELED for consistency with protobuf enums.
  • src/a2a/server/agent_execution/context.py
    • Updated imports to use new protobuf types for Message, SendMessageConfiguration, and SendMessageRequest.
    • Simplified error handling by directly raising InvalidParamsError instead of wrapping it in ServerError.
  • src/a2a/server/agent_execution/request_context_builder.py
    • Updated imports to use new protobuf types for SendMessageRequest.
  • src/a2a/server/agent_execution/simple_request_context_builder.py
    • Updated imports to use new protobuf types for SendMessageRequest.
  • src/a2a/server/apps/jsonrpc/fastapi_app.py
    • Updated OpenAPI generation to prioritize loading a2a.json schema if available.
    • Refactored A2ARequest schema generation to handle protobuf types.
    • Removed deprecated agent card paths (PREV_AGENT_CARD_WELL_KNOWN_PATH, EXTENDED_AGENT_CARD_PATH).
    • Added enable_v0_3_compat option to enable v0.3 backward compatibility.
  • src/a2a/server/apps/jsonrpc/jsonrpc_app.py
    • Updated imports to use new protobuf types and JSON-RPC error models.
    • Refactored _generate_error_response to use new JSON-RPC error models and improved logging.
    • Updated _handle_requests to parse JSON-RPC 2.0 requests and route to v0.3 adapter if enabled.
    • Refactored _process_streaming_request and _process_non_streaming_request to use new protobuf request types and return dicts.
    • Removed deprecated agent card paths from add_routes_to_app and build methods.
    • Added enable_v0_3_compat and _v03_adapter for v0.3 compatibility.
  • src/a2a/server/apps/jsonrpc/starlette_app.py
    • Updated imports to use new protobuf types.
    • Removed deprecated agent card paths (PREV_AGENT_CARD_WELL_KNOWN_PATH, EXTENDED_AGENT_CARD_PATH).
    • Added enable_v0_3_compat option to enable v0.3 backward compatibility.
  • src/a2a/server/apps/rest/fastapi_app.py
    • Added _HTTP_TO_GRPC_STATUS_MAP for mapping HTTP status codes to gRPC status codes.
    • Added enable_v0_3_compat option and _v03_adapter for v0.3 backward compatibility.
    • Implemented a global exception handler for StarletteHTTPException to format errors into A2A standard.
  • src/a2a/server/apps/rest/rest_adapter.py
    • Refactored RESTAdapter to implement RESTAdapterInterface.
    • Updated error handling in _handle_request and _handle_streaming_request.
    • Updated handle_get_agent_card and _handle_authenticated_agent_card to use MessageToDict for serialization.
    • Refactored routes method to include tenant routing.
    • Added _build_call_context helper method.
  • src/a2a/server/context.py
    • Added tenant field to ServerCallContext for multi-tenancy support.
  • src/a2a/server/events/event_consumer.py
    • Updated imports to use new protobuf types for Message, Task, TaskState, and TaskStatusUpdateEvent.
    • Simplified error handling by directly raising InternalError instead of wrapping it in ServerError.
    • Updated is_final_event logic to use new TaskState enums.
  • src/a2a/server/events/event_queue.py
    • Updated imports to use new protobuf types for Message, Task, TaskArtifactUpdateEvent, and TaskStatusUpdateEvent.
  • src/a2a/server/jsonrpc_models.py
    • Added a new file defining JSON-RPC 2.0 error models (JSONRPCError, JSONParseError, InvalidRequestError, MethodNotFoundError, InvalidParamsError, InternalError).
  • src/a2a/server/models.py
    • Updated imports to use new protobuf types for Artifact, Message, and TaskStatus.
    • Removed PydanticType and PydanticListType as SQLAlchemy now directly handles JSON serialization of protobuf messages.
    • Added owner, last_updated, and protocol_version columns to TaskMixin and PushNotificationConfigMixin.
    • Added a composite index for (owner, last_updated) to TaskMixin and an index for owner to PushNotificationConfigMixin.
  • src/a2a/server/owner_resolver.py
    • Added a new file defining OwnerResolver and a default implementation resolve_user_scope for resolving task ownership.
  • src/a2a/server/request_handlers/default_request_handler.py
    • Updated imports to use new protobuf types for all request and response objects.
    • Simplified error handling by directly raising A2AError types instead of wrapping them in ServerError.
    • Implemented on_list_tasks method for retrieving paginated tasks.
    • Refactored push notification handling to use PushNotificationEvent and ServerCallContext for owner resolution.
    • Updated on_create_task_push_notification_config and on_get_task_push_notification_config to use new protobuf types and owner resolution.
    • Updated on_subscribe_to_task to yield Task as the first event.
  • src/a2a/server/request_handlers/grpc_handler.py
    • Updated imports to use new protobuf types and grpc_status for rich error details.
    • Refactored abort_context to use grpc_status and google.rpc.status_pb2 for standardized error reporting.
    • Added _ERROR_CODE_MAP for mapping A2A errors to gRPC status codes.
    • Updated all service methods to use new protobuf request types and _build_call_context helper.
  • src/a2a/server/request_handlers/jsonrpc_handler.py
    • Updated imports to use new protobuf types and JSON-RPC error models.
    • Refactored _build_success_response and _build_error_response to use JSONRPC20Response.
    • Updated all service methods to use new protobuf request types and return dicts.
    • Removed prepare_response_object as it's no longer needed with direct dict responses.
  • src/a2a/server/request_handlers/request_handler.py
    • Updated imports to use new protobuf types for all request and response objects.
    • Added on_list_tasks abstract method for retrieving tasks.
    • Updated abstract methods to reflect new protobuf request types.
  • src/a2a/server/request_handlers/response_helpers.py
    • Updated imports to use new protobuf types and JSON-RPC error models.
    • Refactored agent_card_to_dict to merge v1.0 protobuf AgentCard with v0.3 compatibility fields.
    • Refactored build_error_response to use new JSON-RPC error models and JSON_RPC_ERROR_CODE_MAP.
    • Refactored prepare_response_object to return dicts and handle protobuf messages directly.
  • src/a2a/server/request_handlers/rest_handler.py
    • Updated imports to use new protobuf types and simplified error handling.
    • Refactored on_message_send and on_message_send_stream to use new protobuf request types.
    • Updated on_cancel_task, on_subscribe_to_task, get_push_notification, set_push_notification, on_get_task to use new protobuf request types.
    • Implemented list_tasks and list_push_notifications methods.
  • src/a2a/server/tasks/init.py
    • Added PushNotificationEvent to __all__ for better visibility.
  • src/a2a/server/tasks/base_push_notification_sender.py
    • Updated imports to use new protobuf types and ServerCallContext.
    • Refactored send_notification to accept task_id and PushNotificationEvent.
    • Updated _dispatch_notification to serialize PushNotificationEvent to JSON using to_stream_response.
  • src/a2a/server/tasks/database_push_notification_config_store.py
    • Updated imports to use new protobuf types and ServerCallContext.
    • Refactored _to_orm and _from_orm to handle protobuf TaskPushNotificationConfig and include owner and protocol_version.
    • Added owner_resolver and core_to_model_conversion/model_to_core_conversion for compatibility.
    • Updated set_info, get_info, and delete_info to be owner-aware.
  • src/a2a/server/tasks/database_task_store.py
    • Updated imports to use new protobuf types and ServerCallContext.
    • Refactored _to_orm and _from_orm to handle protobuf Task and include owner and protocol_version.
    • Added owner_resolver and core_to_model_conversion/model_to_core_conversion for compatibility.
    • Implemented list method for retrieving paginated tasks with filtering and sorting.
  • src/a2a/server/tasks/inmemory_push_notification_config_store.py
    • Updated imports to use new protobuf types and ServerCallContext.
    • Added owner_resolver and refactored set_info, get_info, delete_info to be owner-aware and handle nested dictionaries.
  • src/a2a/server/tasks/inmemory_task_store.py
    • Updated imports to use new protobuf types and ServerCallContext.
    • Added owner_resolver and refactored save, get, delete to be owner-aware and handle nested dictionaries.
    • Implemented list method for retrieving paginated tasks with filtering and sorting.
  • src/a2a/server/tasks/push_notification_config_store.py
    • Updated imports to use new protobuf types.
    • Updated abstract methods to include context parameter for owner resolution.
  • src/a2a/server/tasks/push_notification_sender.py
    • Updated imports to use new protobuf types.
    • Refactored send_notification to accept task_id and PushNotificationEvent.
  • src/a2a/server/tasks/result_aggregator.py
    • Updated imports to use new protobuf types.
    • Refactored consume_and_break_on_interrupt and _continue_consuming to pass Event to event_callback.
  • src/a2a/server/tasks/task_manager.py
    • Updated imports to use new protobuf types and simplified error handling by directly raising InvalidParamsError.
    • Refactored save_task_event and update_with_message to use protobuf field presence checks and MergeFrom.
  • src/a2a/server/tasks/task_store.py
    • Updated imports to use new protobuf types.
    • Added list abstract method for retrieving tasks.
  • src/a2a/server/tasks/task_updater.py
    • Updated imports to use new protobuf types and Timestamp.
    • Removed final parameter from update_status.
    • Updated complete, failed, reject, cancel, requires_input, requires_auth to use new TaskState enums.
  • src/a2a/types/init.py
    • Added a new __init__.py file to consolidate proto-generated types and SDK-specific error types, providing a unified import interface.
Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/linter.yaml
    • .github/workflows/release-please.yml
    • .github/workflows/unit-tests.yml
    • .github/workflows/update-a2a-types.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@bartek-w bartek-w force-pushed the bartekw-agent-card-v03 branch from 686643b to 2768904 Compare March 17, 2026 11:41
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively ensures backward compatibility with v0.3 of the A2A protocol by filtering agent card interfaces. The refactoring of the legacy version check into a shared utility function is a solid improvement for code reuse and maintainability. The core logic change in to_compat_agent_card is well-implemented, including robust error handling for cases where no compatible interfaces are found. The accompanying tests are thorough and provide excellent coverage for the new functionality and edge cases. I've added a few minor suggestions to further improve code clarity and consistency in the tests.

I am having trouble creating individual review comments. Click here to see my feedback.

tests/compat/v0_3/test_rest_transport.py (304-307)

low

This nested if method == 'POST' check is redundant, as the outer if statement on line 303 already confirms that method is 'POST'. Consequently, the else branch on line 306 is unreachable. You can simplify this block by removing the inner conditional.

            assert json == {'id': 'task-123'}

tests/compat/v0_3/test_conversions.py (989-991)

low

To improve maintainability and consistency with the implementation, consider using the constants.PROTOCOL_VERSION_0_3 constant here instead of the hardcoded string '0.3'. This ensures the test remains aligned with the implementation if the constant's value ever changes. You will need to add from a2a.utils import constants at the top of the file.

    v10_expected = pb2_v10.AgentInterface(
        url='http', protocol_binding='JSONRPC', protocol_version=constants.PROTOCOL_VERSION_0_3
    )

tests/compat/v0_3/test_conversions.py (1134-1136)

low

Similar to the previous comment, using the constants.PROTOCOL_VERSION_0_3 constant here would improve consistency and maintainability.

            pb2_v10.AgentInterface(
                url='u2', protocol_binding='HTTP', protocol_version=constants.PROTOCOL_VERSION_0_3
            ),

@bartek-w bartek-w closed this Mar 17, 2026
@github-actions
Copy link
Copy Markdown

🧪 Code Coverage (vs 1.0-dev)

⬇️ Download Full Report

Base PR Delta
src/a2a/client/client_factory.py 88.89% 89.35% 🟢 +0.46%
src/a2a/server/request_handlers/response_helpers.py 95.52% 95.71% 🟢 +0.19%
src/a2a/compat/v0_3/versions.py (new) 100.00%
Total 89.98% 90.02% 🟢 +0.04%

Generated by coverage-comment.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: 0.3 compatibility

1 participant