Skip to content

fix: align send_message signature for Client and BaseClient (#727)#739

Closed
Akshat8510 wants to merge 36 commits intoa2aproject:mainfrom
Akshat8510:fix/align-client-signature
Closed

fix: align send_message signature for Client and BaseClient (#727)#739
Akshat8510 wants to merge 36 commits intoa2aproject:mainfrom
Akshat8510:fix/align-client-signature

Conversation

@Akshat8510
Copy link
Copy Markdown
Contributor

Aligned the send_message signature in Client with BaseClient.

Note: I used SendMessageConfiguration (instead of MessageSendConfiguration mentioned in the issue) because SendMessageConfiguration is the correct attribute name found in a2a_pb2, as verified by mypy.

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run bash scripts/format.sh from the repository root to format)
  • [] Appropriate docs were updated (if necessary)

Fixes #727 🦕

lkawka and others added 30 commits November 13, 2025 11:12
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Yaroslav <yarolegovich@gmail.com>
Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com>
Co-authored-by: agil.yolchuyev <agilyolchuyev@outlook.com>
Co-authored-by: yolagil <agil@peotic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…the specification (a2aproject#511)

Commit:
a2aproject/A2A@0a9f629

This PR introduces support for the new `tasks/list` method, including:
- Automatically generated type definitions from the specification.
- Complete client-side and server-side implementations.

Fixes a2aproject#515 🦕

---------

Co-authored-by: lkawka <lkawka@google.com>
Co-authored-by: lkawka <luk.kawka@gmail.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com>
Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com>
Co-authored-by: Tadaki Asechi <127199356+TadakiAsechi@users.noreply.github.com>
Co-authored-by: tadaki <tadaki.asechi@gmail.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: TadakiAsechi <tadaki.asechi@icould.com>
Co-authored-by: TadakiAsechi <tadaki.asechi@iclould.com>
## Summary

This PR migrates the a2a-python SDK from Pydantic-based types to
protobuf-generated types, completing the upgrade to A2A v1.0. Fixes a2aproject#559

## Breaking Changes

- Replace Pydantic-based type system with protobuf types from `a2a_pb2`
- Update `Part` usage from `Part(root=TextPart(text=...))` to
`Part(text=...)`
- Update `Role` enum from `Role.user`/`Role.agent` to
`Role.ROLE_USER`/`Role.ROLE_AGENT`
- Update `TaskState` enum to use `TASK_STATE_*` prefix

## Changes

- Update all source files to use proto types directly from `a2a_pb2`
- Replace `model_dump()` with `MessageToDict()` for JSON serialization
- Replace `model_copy(deep=True)` with `CopyFrom()` for proto cloning
- Add new types module with proto imports and SDK-specific extras
- Add `proto_utils` module with identity conversion utilities
- Fix REST handler resource name formats for push notification configs
- Fix gRPC handler to use `SubscribeToTask` instead of
`TaskSubscription`
- Fix database task store to handle proto objects from ORM
- Update all test files for proto patterns and assertions
- Fix spelling check failures by updating allow list
- Fix inclusive language check failures:
    - Replace `master` with `main` in documentation
    - Rename `Dummy` classes to `Mock` in tests

## Testing

- **601 tests passing**
- 23 tests skipped (expected - require DB connections or cryptography
deps)

## Related

Builds on top of PR a2aproject#556

Release-As: 1.0.0

---------

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Co-authored-by: Lukasz Kawka <luk.kawka@gmail.com>
Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com>
Co-authored-by: Didier Durand <2927957+didier-durand@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com>
Co-authored-by: Will Chen <36873565+chenweiyang0204@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Description

Do not use `NULLS LAST` which is not available in MySQL, coalesce nulls
to empty strings which will appear last in descending ordering (there
are tests for this behavior already, however CI wasn't enabled for this
branch).

Currently `NULLS LAST` fails MySQL tests:

```
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULLS LAST, tasks.id DESC \n LIMIT 51' at line 3")
```
([actions
run](https://github.com/a2aproject/a2a-python/actions/runs/21520017047/job/62008309612?pr=651))

Enable tests run against `1.0-dev` to prevent it in the future.

Re a2aproject#511 
Fixes a2aproject#652 

---
Mark as "refactor" for release please as it's a fix for a non-released
feature, hence shouldn't get into a changelog.

BEGIN_COMMIT_OVERRIDE
refactor: use MySQL compatible syntax in list tasks
END_COMMIT_OVERRIDE
# Conflicts:
#	CHANGELOG.md
#	tests/client/transports/test_rest_client.py
#	tests/utils/test_proto_utils.py
# Description

Merge `main` into `1.0-dev` through an intermediate branch to resolve
conflicts. Opening a PR from `main` to `1.0-dev` required pushing to
`main` to resolve conflicts.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com>
Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com>
Co-authored-by: Tadaki Asechi <127199356+TadakiAsechi@users.noreply.github.com>
Co-authored-by: tadaki <tadaki.asechi@gmail.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: TadakiAsechi <tadaki.asechi@icould.com>
Co-authored-by: TadakiAsechi <tadaki.asechi@iclould.com>
Co-authored-by: ShishirRmc <113575088+ShishirRmc@users.noreply.github.com>
Co-authored-by: Lukasz Kawka <luk.kawka@gmail.com>
Co-authored-by: Didier Durand <2927957+didier-durand@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Will Chen <36873565+chenweiyang0204@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Vinay Ramesh <vinay.r.ramesh@gmail.com>
# Description

Run linter on `1.0-dev`.
This reverts commit 40613ed.

Should be merged without squashing
…#665)

## Description
Updates the SDK to support the A2A Protocol v1.0.0-rc specifications.

## Changes
- **Protocol Update**: Updated core types, definitions, `Client`, and
`Server` implementations to match Protocol v1.0.0-rc.
- **Bug Fixes**:
    - Fixed `RestTransport` URL construction.
- Resolved `pyright`, `ruff`, and `mypy` linting errors across the
codebase.
- Fixed import resolution issues for optional dependencies (`grpc`,
`sqlalchemy`, `opentelemetry`).
- **Tests**:
    - Fixed all failing unit and integration tests.
- Added support for running PostgreSQL and MySQL integration tests
(verified locally).
- **Cleanup**: Removed redundant `pyrightconfig.json`.

## Testing
- All unit and integration tests are passing.
- Database integration tests verified locally with Docker containers
(docker-compose file was used for verification but is not included in
the repo).

Re a2aproject#559

---------

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
To resolve existing merge issues first.
Fixes
a2aproject#697 (comment),
bad merge in a2aproject#696.

Cover "list tasks" in client-server integration tests which would
prevent it.

Re a2aproject#559.
Bring back `.pre-commit-config.yaml` and disabled JSCPD linter.

Removal can be evaluated separately, for now bringing them back to make
diff against `main` more focused.

Re a2aproject#559.
Tests basic functionality with real client and server with real
handlers, only agent executor is provided in test as it'd be in a real
usage.

Re a2aproject#559
JSON-RPC diverged a bit, update it to match other transports. Domain
request handler returns `Task | Message` from `on_message_send` already.

Fixes
a2aproject#697 (comment).

Re a2aproject#559.
According to [the
spec](https://a2a-protocol.org/latest/specification/#314-list-tasks) all
response fields are mandatory. Update implementation and add tests to
cover.

Re a2aproject#515
Active updates are happening to [A2A
repo](https://github.com/a2aproject/A2A/commits/main/) currently. Switch
`buf.gen.yaml` back to `main` (a2aproject#699 switched it to the 1.0 RC tag to
progress with merge without regenerating files) and update code to work
with the latest changes.

Re a2aproject#559.
Following

> The operation MUST return a Task object as the first event in the
stream

introduced in 1.0:
https://a2a-protocol.org/latest/specification/#316-subscribe-to-task

It also correctly uses `UnsupportedOperationError` as per the "Errors"
section from the documentation linked above.

Fixes a2aproject#675

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
According to
https://a2a-protocol.org/latest/specification/#324-history-length-semantics.
It changes behavior so the fix was postponed till 1.0.

After changing to proto passing `.history_length` would not work anymore
due to the way how proto generated code works - optional values are
still translated to language defaults to avoid `None`s, while presence
should be checked via `HasField` - done in this PR.

Fixes a2aproject#573

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
## Description

As per the 1.0 spec update (see [4.3.3. Push Notification
Payload](https://a2a-protocol.org/latest/specification/#433-push-notification-payload))
use `StreamResponse` as push notifications payload.

Fixes a2aproject#678

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Use enum everywhere, data model uses `str` for protocol names, so custom
protocols won't be constrained with the enum.

Fixes a2aproject#705
ishymko and others added 6 commits February 23, 2026 15:42
…ject#732)

Rely on the `ClientFactory` to resolve proper URL and do not duplicate
logic in transports. `AgentCard` is still passed to transports as it's
used for capabilities inspection.

Make both `agent_card` and `url` mandatory, transports are mainly used
from the `ClientFactory` and `| None` are likely non-breaking leftovers.

Fixes a2aproject#703
According to the [npx docs](https://docs.npmjs.com/cli/v8/commands/npx):

> If any requested packages are not present in the local project
dependencies, then they are installed to a folder in the npm cache,
which is added to the PATH environment variable in the executed process.
A prompt is printed (which can be suppressed by providing either --yes
or --no).

Running it in non-interactive manner hangs build process and waits for
keyboard input.

See a2aproject#706 for potential long-term solution.

Was originally added in a2aproject#696.
# Description

- Test artifacts.
- Add more assertions for streaming: validate all events.
- Fix non-streaming tests which were actually streaming.
Signed-off-by: Akshat Kumar <akshat230405@gmail.com>
@Akshat8510 Akshat8510 requested review from a team and a2a-bot as code owners February 25, 2026 17:05
@Akshat8510 Akshat8510 closed this Feb 25, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Akshat8510, 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 introduces a fundamental shift in how A2A protocol types are handled within the Python SDK, moving from Pydantic models to native Protobuf messages. This change impacts both client and server components, ensuring a more robust and consistent API experience. The update also refines the type generation process, consolidates generated files, and enhances error handling mechanisms, contributing to a more maintainable and performant codebase.

Highlights

  • Migration to Protobuf for Core Types: The SDK has undergone a significant architectural shift, replacing Pydantic-based models for core A2A types (like AgentCard, Message, Task) with Protocol Buffer (Protobuf) generated classes. This enhances type safety, consistency, and interoperability across different language implementations of the A2A protocol.
  • Streamlined Type Generation Workflow: The process for generating Python types from the A2A specification has been overhauled. Old scripts relying on datamodel-code-generator have been removed and replaced with a buf-based workflow that generates Protobuf Python classes, type stubs (.pyi), and an OpenAPI (Swagger) JSON specification directly from the .proto files. Generated files are now consolidated under src/a2a/types.
  • Client and Server API Alignment: The send_message signature in Client and BaseClient has been aligned, and various client and server methods now directly use the new Protobuf request and response types (e.g., SendMessageRequest, StreamResponse, GetTaskRequest, ListTasksRequest). This ensures a consistent API surface across different transport layers (JSON-RPC, REST, gRPC).
  • Deprecation and Removal of Legacy Client Classes: The A2AClient and A2AGrpcClient legacy client classes, along with their associated files, have been removed. Users are now encouraged to use the ClientFactory for creating clients with specific transports.
  • Enhanced Error Handling and Serialization: JSON-RPC error handling has been refactored to use dedicated Pydantic models for standard JSON-RPC errors, improving clarity and consistency. Serialization/deserialization logic in transports and server apps now directly leverages Protobuf's MessageToDict and ParseDict functions, eliminating intermediate Pydantic models for proto-derived data.
  • Improved Task Management and Listing Capabilities: The ClientTaskManager and server-side task handling have been updated to work seamlessly with StreamResponse objects. New list_tasks functionality has been introduced, allowing for filtering and pagination of tasks, with corresponding validation for history length and page size.
Changelog
  • .git-blame-ignore-revs
    • Updated the template URL from 'master' to 'main'.
  • .github/actions/spelling/allow.txt
    • Added numerous new words to the spelling allow list, reflecting new dependencies and code terminology.
  • .github/actions/spelling/excludes.txt
    • Added exclusions for the new 'src/a2a/types/' directory and 'a2a.json' files from spell checking.
  • .gitignore
    • Added 'src/a2a/types/a2a.json' and 'docker-compose.yaml' to the ignore list.
  • CODE_OF_CONDUCT.md
    • Updated the repository URL from 'master' to 'main'.
  • buf.gen.yaml
    • Modified the Protobuf generation input subdirectory from 'specification/grpc' 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) into 'src/a2a/types'.
  • pyproject.toml
    • Added 'json-rpc' and 'googleapis-common-protos' to runtime dependencies.
    • Added 'hatch-build-scripts' to build system requirements.
    • Configured 'hatch.build.hooks.build-scripts' to run 'scripts/gen_proto.sh' and include 'src/a2a/types/a2a.json' as an artifact.
    • Added filter warnings for SQLAlchemy and asyncio resource warnings in pytest configuration.
    • Removed 'datamodel-code-generator' and added 'PyJWT' to development dependencies.
    • Updated 'exclude' paths for 'mypy', 'ruff', and 'coverage' tools to reflect the new 'src/a2a/types' directory structure for generated Protobuf files.
  • scripts/checkout_experimental_types.sh
    • Removed the script for checking out experimental types.
  • scripts/gen_proto.sh
    • Added a new script to run 'buf generate', rename the generated Swagger JSON to 'a2a.json', and fix imports in 'a2a_pb2_grpc.py'.
  • scripts/generate_types.sh
    • Removed the script for generating types, replaced by the 'buf' workflow.
  • scripts/grpc_gen_post_processor.py
    • Removed the gRPC post-processor script, its functionality is now integrated into 'gen_proto.sh'.
  • src/a2a/client/init.py
    • Removed imports and exports for legacy client classes 'A2AClient' and 'A2AGrpcClient'.
  • src/a2a/client/auth/interceptor.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored authentication logic to use Protobuf's 'HasField' and direct attribute access for security schemes.
  • src/a2a/client/base_client.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'send_message' signature and implementation to use 'SendMessageConfiguration' and 'SendMessageRequest' Protobuf types, and handle 'StreamResponse' objects.
    • Introduced '_process_stream' method for handling streaming responses.
    • Updated method signatures for task-related operations ('get_task', 'cancel_task', 'set_task_callback', 'get_task_callback', 'subscribe', 'get_extended_agent_card') to use new Protobuf request/response types.
    • Added 'list_tasks' method.
  • src/a2a/client/card_resolver.py
    • Replaced Pydantic's 'ValidationError' with Protobuf's 'ParseError' for JSON validation.
    • Updated 'get_agent_card' to use 'ParseDict' for deserializing AgentCard from JSON.
  • src/a2a/client/client.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Renamed 'supported_transports' to 'supported_protocol_bindings' in 'ClientConfig'.
    • Adjusted 'ClientEvent' and 'Consumer' type aliases to align with 'StreamResponse' usage.
    • Updated abstract method signatures to match the new Protobuf-based API.
  • src/a2a/client/client_factory.py
    • Updated imports to use Protobuf-generated types and 'TransportProtocol' from 'a2a.utils.constants'.
    • Refactored transport registration and creation logic to use 'supported_protocol_bindings' and 'AgentInterface.protocol_binding'.
  • src/a2a/client/client_task_manager.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored 'save_task_event' to 'process' and updated its logic to handle 'StreamResponse' objects.
    • Modified 'update_with_message' to use Protobuf's 'HasField' and 'ClearField' for message status.
  • src/a2a/client/errors.py
    • Removed dependency on 'a2a.types.JSONRPCErrorResponse' and updated 'A2AClientJSONRPCError' to accept a raw dictionary for error details.
  • src/a2a/client/legacy.py
    • Removed the legacy A2AClient compatibility layer.
  • src/a2a/client/legacy_grpc.py
    • Removed the legacy A2AGrpcClient compatibility layer.
  • src/a2a/client/middleware.py
    • Updated imports to use Protobuf-generated 'AgentCard' from 'a2a.types.a2a_pb2'.
  • src/a2a/client/optionals.py
    • Updated type ignore comments and terminology from 'dummy' to 'stub' for optional gRPC channel.
  • src/a2a/client/transports/base.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified abstract method signatures to align with new Protobuf request/response types and streaming models.
    • Renamed 'get_card' to 'get_extended_agent_card'.
  • src/a2a/client/transports/grpc.py
    • Updated gRPC imports with type ignore comments.
    • Changed imports to use Protobuf-generated types from 'a2a.types'.
    • Refactored method implementations to directly use Protobuf request/response objects, removing intermediate 'proto_utils' conversions.
    • Updated 'get_card' to 'get_extended_agent_card' and adjusted logic for extended agent card capabilities.
  • src/a2a/client/transports/jsonrpc.py
    • Added imports for 'google.protobuf.json_format' and 'jsonrpc.jsonrpc2.JSONRPC20Request', 'JSONRPC20Response'.
    • Removed 'A2ACardResolver' import.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored constructor to directly require 'agent_card' and 'url'.
    • Updated method implementations to use 'JSONRPC20Request' and 'JSONRPC20Response' for requests/responses, and 'json_format.MessageToDict'/'ParseDict' for serialization.
    • Removed reliance on 'A2ACardResolver' for fetching extended agent cards.
  • src/a2a/client/transports/rest.py
    • Added imports for 'google.protobuf.json_format.ParseDict' and 'google.protobuf.message.Message'.
    • Removed 'A2ACardResolver' import.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored constructor to directly require 'agent_card' and 'url', and handle URL trailing slashes.
    • Updated method implementations to use 'json_format.MessageToDict'/'ParseDict' for serialization and deserialization.
    • Added helper functions '_model_to_query_params' and '_json_to_query_params' for query parameter handling.
    • Removed reliance on 'A2ACardResolver' for fetching extended agent cards.
  • src/a2a/grpc/a2a_pb2.py
    • Removed, as Protobuf-generated types are now located in 'src/a2a/types'.
  • src/a2a/server/agent_execution/agent_executor.py
    • Updated 'TaskState.canceled' to 'TaskState.TASK_STATE_CANCELED' for Protobuf enum consistency.
  • src/a2a/server/agent_execution/context.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Changed 'request' type from 'MessageSendParams' to 'SendMessageRequest'.
    • Updated 'configuration' property to return 'SendMessageConfiguration'.
    • Modified 'metadata' property to handle Protobuf 'Struct' objects.
  • src/a2a/server/agent_execution/request_context_builder.py
    • Updated 'params' type from 'MessageSendParams' to 'SendMessageRequest'.
  • src/a2a/server/agent_execution/simple_request_context_builder.py
    • Updated 'params' type from 'MessageSendParams' to 'SendMessageRequest'.
  • src/a2a/server/apps/jsonrpc/fastapi_app.py
    • Added imports for 'importlib.resources' and 'json'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'openapi' method to prioritize loading 'a2a.json' schema from 'a2a.types' if available, falling back to auto-generation.
    • Updated logic to check 'agent_card.capabilities.extended_agent_card' instead of 'supports_authenticated_extended_card'.
  • src/a2a/server/apps/jsonrpc/jsonrpc_app.py
    • Added imports for 'google.protobuf.json_format' and 'jsonrpc.jsonrpc2.JSONRPC20Request', 'JSONRPC20Response'.
    • Removed 'pydantic.ValidationError' import.
    • Updated imports for JSON-RPC error models to 'a2a.server.jsonrpc_models'.
    • Updated imports for A2A request types to 'a2a.types.a2a_pb2'.
    • Refactored 'METHOD_TO_MODEL' to map gRPC method names to Protobuf request types.
    • Updated '_generate_error_response' to use a new helper function for consistent error formatting.
    • Rewrote '_handle_requests' to parse JSON-RPC requests using 'JSONRPC20Request' and Protobuf's 'ParseDict'.
    • Updated '_process_streaming_request' and '_process_non_streaming_request' to handle Protobuf request objects directly.
    • Refactored '_create_response' to return dictionaries and use 'json.dumps' for streaming events.
    • Updated agent card handling to use 'MessageToDict' for serialization.
  • src/a2a/server/apps/jsonrpc/starlette_app.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Updated logic to check 'agent_card.capabilities.extended_agent_card' instead of 'supports_authenticated_extended_card'.
  • src/a2a/server/apps/rest/fastapi_app.py
    • Updated imports to use Protobuf-generated 'AgentCard' from 'a2a.types.a2a_pb2'.
  • src/a2a/server/apps/rest/rest_adapter.py
    • Added import for 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated 'AgentCard' from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Updated 'handle_get_agent_card' and 'handle_authenticated_agent_card' to use 'MessageToDict' for serialization.
    • Updated logic to check 'agent_card.capabilities.extended_agent_card' instead of 'supports_authenticated_extended_card'.
    • Renamed 'on_resubscribe_to_task' to 'on_subscribe_to_task' in routes.
  • src/a2a/server/events/event_consumer.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Updated terminal task states to use Protobuf enum values (e.g., 'TASK_STATE_COMPLETED').
  • src/a2a/server/events/event_queue.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
  • src/a2a/server/jsonrpc_models.py
    • Added a new file defining Pydantic models for standard JSON-RPC 2.0 errors, replacing previous error handling.
  • src/a2a/server/models.py
    • Added imports for 'google.protobuf.json_format' and 'google.protobuf.message.Message'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored 'PydanticType' and 'PydanticListType' to handle serialization and deserialization of Protobuf messages to/from JSON in SQLAlchemy.
    • Updated '_to_orm' and '_from_orm' methods to correctly map Protobuf 'Task' fields to SQLAlchemy models.
  • src/a2a/server/request_handlers/default_request_handler.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Added 'PushNotificationEvent' import.
    • Updated terminal task states to use Protobuf enum values.
    • Modified 'on_get_task' to use 'validate_history_length' and 'apply_history_length'.
    • Added 'on_list_tasks' method for task listing with pagination.
    • Updated 'on_cancel_task' to use 'TaskState.TASK_STATE_CANCELED'.
    • Modified '_send_push_notification_if_needed' to accept 'PushNotificationEvent'.
    • Updated 'on_message_send' and 'on_message_send_stream' to use 'SendMessageRequest' and validate history length.
    • Renamed 'on_set_task_push_notification_config' to 'on_create_task_push_notification_config' and adjusted its logic.
    • Updated 'on_get_task_push_notification_config' to handle multiple configurations and use specific IDs.
    • Renamed 'on_resubscribe_to_task' to 'on_subscribe_to_task' and adjusted its logic to yield the initial 'Task' object.
    • Renamed 'on_list_task_push_notification_config' to 'on_list_task_push_notification_configs' and updated its return type.
    • Updated 'on_delete_task_push_notification_config' to use specific IDs.
  • src/a2a/server/request_handlers/grpc_handler.py
    • Updated gRPC imports with type ignore comments.
    • Changed imports to use Protobuf-generated types from 'a2a.types'.
    • Added 'JSONParseError' import from 'a2a.server.jsonrpc_models'.
    • Refactored method implementations to directly use Protobuf request/response objects, removing intermediate 'proto_utils' conversions.
    • Updated 'abort_context' to handle 'JSONParseError'.
  • src/a2a/server/request_handlers/jsonrpc_handler.py
    • Added imports for 'google.protobuf.json_format' and 'jsonrpc.jsonrpc2.JSONRPC20Response'.
    • Updated imports for JSON-RPC error models to 'a2a.server.jsonrpc_models'.
    • Updated imports for A2A request types to 'a2a.types.a2a_pb2'.
    • Introduced 'EXCEPTION_MAP' and 'ERROR_CODE_MAP' for consistent error mapping.
    • Refactored '_build_success_response' and '_build_error_response' helper functions.
    • Updated 'METHOD_TO_MODEL' to map gRPC method names to Protobuf request types.
    • Rewrote '_generate_error_response' to use the new error handling helpers.
    • Refactored '_handle_requests' to parse JSON-RPC requests using 'JSONRPC20Request' and Protobuf's 'ParseDict'.
    • Updated '_process_streaming_request' and '_process_non_streaming_request' to handle Protobuf request objects directly and use new method names.
    • Refactored '_create_response' to return dictionaries and use 'json.dumps' for streaming events.
    • Updated agent card handling to use 'MessageToDict' for serialization.
  • src/a2a/server/request_handlers/request_handler.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Modified abstract method signatures to align with new Protobuf request/response types for all operations.
  • src/a2a/server/request_handlers/response_helpers.py
    • Removed Pydantic-specific type variables and RootModel types.
    • Added imports for 'google.protobuf.json_format', 'google.protobuf.message.Message', and 'jsonrpc.jsonrpc2.JSONRPC20Response'.
    • Updated imports for JSON-RPC error models to 'a2a.server.jsonrpc_models'.
    • Updated imports for A2A event types to 'a2a.types.a2a_pb2'.
    • Introduced 'EXCEPTION_MAP' and 'ERROR_CODE_MAP' for consistent error mapping.
    • Refactored 'build_error_response' and 'prepare_response_object' to work with dictionaries and Protobuf messages.
  • src/a2a/server/request_handlers/rest_handler.py
    • Added import for 'google.protobuf.json_format.ParseDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored method implementations to directly use Protobuf request/response objects and 'json_format.MessageToDict'/'ParseDict' for serialization.
    • Updated agent card capabilities check for extended agent card.
    • Added '_model_to_query_params' helper function.
  • src/a2a/server/tasks/init.py
    • Added 'PushNotificationEvent' to the module's exports.
  • src/a2a/server/tasks/base_push_notification_sender.py
    • Added import for 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Added 'PushNotificationEvent' import.
    • Modified 'send_notification' and '_dispatch_notification' to handle 'PushNotificationEvent' and use 'to_stream_response' for serialization.
  • src/a2a/server/tasks/database_push_notification_config_store.py
    • Replaced 'pydantic.ValidationError' with 'google.protobuf.json_format.Parse'.
    • Updated SQLAlchemy imports for better compatibility.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored '_to_orm' and '_from_orm' to use 'MessageToJson'/'Parse' for Protobuf messages.
    • Modified 'set_info' to use Protobuf's 'CopyFrom' and check for empty IDs.
    • Updated 'delete_info' to include type ignore for 'rowcount'.
  • src/a2a/server/tasks/database_task_store.py
    • Updated SQLAlchemy imports to include 'and_', 'func', 'or_'.
    • Added import for 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Added imports for 'DEFAULT_LIST_TASKS_PAGE_SIZE', 'decode_page_token', 'encode_page_token'.
    • Refactored '_to_orm' and '_from_orm' to handle Protobuf messages directly.
    • Implemented 'list' method for task pagination, including filtering, sorting, and token-based pagination.
    • Updated 'delete' method to include type ignore for 'rowcount'.
  • src/a2a/server/tasks/inmemory_push_notification_config_store.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'set_info' to check for empty IDs.
  • src/a2a/server/tasks/inmemory_task_store.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Added imports for 'DEFAULT_LIST_TASKS_PAGE_SIZE', 'decode_page_token', 'encode_page_token'.
    • Implemented 'list' method for in-memory task pagination, including filtering, sorting, and token-based pagination.
  • src/a2a/server/tasks/push_notification_config_store.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
  • src/a2a/server/tasks/push_notification_sender.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Defined 'PushNotificationEvent' type alias.
    • Modified 'send_notification' signature to accept 'task_id' and 'PushNotificationEvent'.
  • src/a2a/server/tasks/result_aggregator.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'consume_and_break_on_interrupt' and '_continue_consuming' to accept 'event_callback' with an 'Event' argument.
    • Updated 'is_auth_required' check to use Protobuf enum values.
  • src/a2a/server/tasks/task_manager.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.utils.errors'.
    • Modified 'save_task_event' to use Protobuf's 'HasField' and 'MergeFrom' for status and metadata updates.
    • Updated '_init_task_obj' to use 'TaskState.TASK_STATE_SUBMITTED'.
    • Modified 'update_with_message' to use Protobuf's 'HasField' and 'ClearField' for message status.
  • src/a2a/server/tasks/task_store.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Added abstract 'list' method for task retrieval.
  • src/a2a/server/tasks/task_updater.py
    • Added import for 'google.protobuf.timestamp_pb2.Timestamp'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified '_terminal_states' to use Protobuf enum values.
    • Updated 'update_status' to use 'Timestamp' Protobuf objects and remove the 'final' parameter.
    • Adjusted method calls ('complete', 'failed', 'reject', 'submit', 'start_work', 'cancel', 'requires_input', 'requires_auth') to align with new 'update_status' signature and Protobuf enum values.
    • Updated 'new_agent_message' to use 'Role.ROLE_AGENT'.
  • src/a2a/types.py
    • Removed the Pydantic-based 'a2a.types' module, as types are now generated from Protobuf.
  • src/a2a/types/init.py
    • Added a new 'init.py' file to aggregate Protobuf-generated types and SDK-specific error types, providing a unified import interface.
  • src/a2a/types/a2a_pb2.py
    • Added the new Protobuf-generated Python code for A2A types.
  • src/a2a/types/a2a_pb2.pyi
    • Renamed from 'src/a2a/grpc/a2a_pb2.pyi' and updated to reflect new Protobuf enum names (e.g., 'TASK_STATE_CANCELED').
  • src/a2a/types/a2a_pb2_grpc.py
    • Renamed from 'src/a2a/grpc/a2a_pb2_grpc.py' and updated to reflect new Protobuf service names and method signatures.
  • src/a2a/utils/init.py
    • Added imports for 'proto_utils' and 'to_stream_response'.
    • Added 'TransportProtocol' to the module's exports.
  • src/a2a/utils/artifact.py
    • Added imports for 'google.protobuf.struct_pb2.Struct' and 'Value'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'new_text_artifact' and 'new_data_artifact' to create Protobuf 'Part' objects directly.
  • src/a2a/utils/constants.py
    • Added 'DEFAULT_LIST_TASKS_PAGE_SIZE', 'MAX_LIST_TASKS_PAGE_SIZE', 'TransportProtocol' enum, 'DEFAULT_MAX_CONTENT_LENGTH', and 'JSONRPC_PARSE_ERROR_CODE'.
  • src/a2a/utils/error_handlers.py
    • Added 'typing.cast' import.
    • Updated imports to use new JSON-RPC error models from 'a2a.server.jsonrpc_models' and error types from 'a2a.utils.errors'.
    • Refactored error-to-HTTP status mapping to use new error types.
    • Adjusted error property access to use 'getattr' for robustness.
  • src/a2a/utils/errors.py
    • Refactored error classes to be standard Python exceptions, replacing Pydantic 'RootModel' errors.
    • Defined base 'A2AError' and specific error subclasses (e.g., 'TaskNotFoundError', 'InvalidParamsError').
    • Added 'A2AException' as an alias for 'A2AError'.
  • src/a2a/utils/helpers.py
    • Added import for 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'create_task_obj' to use 'SendMessageRequest' and Protobuf enum values for task state.
    • Updated 'append_artifact_to_task' to use Protobuf's 'CopyFrom' for artifact updates.
    • Refactored 'canonicalize_agent_card' to use 'MessageToDict' for Protobuf serialization.
  • src/a2a/utils/message.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'new_agent_text_message' and 'new_agent_parts_message' to use 'Role.ROLE_AGENT' and Protobuf 'Part' objects directly.
  • src/a2a/utils/parts.py
    • Added imports for 'collections.abc.Sequence' and 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored 'get_text_parts', 'get_data_parts', and 'get_file_parts' to work with Protobuf 'Part' objects.
  • src/a2a/utils/proto_utils.py
    • Refactored the module to remove 'ToProto' and 'FromProto' classes.
    • Introduced 'to_stream_response' function to convert internal event types to 'StreamResponse' Protobuf objects.
  • src/a2a/utils/signing.py
    • Modified 'agent_card_signer' to use Protobuf's 'append' method for adding signatures to 'AgentCard'.
  • src/a2a/utils/task.py
    • Added imports for 'binascii', 'base64', 'typing.Literal', 'Protocol', 'runtime_checkable'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and constants/errors from 'a2a.utils'.
    • Modified 'new_task' to use Protobuf enum values for task state and check 'Part.HasField('text')'.
    • Updated 'completed_task' to use Protobuf enum values.
    • Introduced 'HistoryLengthConfig' protocol, 'validate_history_length', 'validate_page_size', 'encode_page_token', and 'decode_page_token' functions.
    • Refactored 'apply_history_length' to work with 'HistoryLengthConfig' and handle Protobuf 'Task' copying.
  • tck/sut_agent.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'cancel' and 'execute' methods to use Protobuf enum values for task states and 'Part' objects directly.
    • Updated 'agent_card' creation to use 'supported_interfaces' and 'AgentInterface' objects.
  • tests/README.md
    • Corrected a minor typo.
  • tests/client/test_auth_middleware.py
    • Added import for 'google.protobuf.json_format'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'TransportProtocol' from 'a2a.utils.constants'.
    • Refactored 'build_success_response' to use 'json_format.MessageToDict' for Protobuf serialization.
    • Modified 'build_message' to use 'Role.ROLE_USER'.
    • Updated 'test_client_with_simple_interceptor' to use 'supported_interfaces' and 'supported_protocol_bindings'.
    • Introduced 'wrap_security_scheme' helper for Protobuf 'SecurityScheme' creation.
    • Updated 'test_auth_interceptor_variants' and 'test_auth_interceptor_skips_when_scheme_not_in_security_schemes' to use new Protobuf-based security types.
  • tests/client/test_base_client.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'sample_agent_card' to use 'supported_interfaces'.
    • Updated 'sample_message' to use 'Role.ROLE_USER' and Protobuf 'Part' objects.
    • Refactored 'test_send_message_streaming' and 'test_send_message_non_streaming' to handle 'StreamResponse' and 'SendMessageResponse' Protobuf objects.
  • tests/client/test_card_resolver.py
    • Updated 'valid_agent_card_data' to use 'supported_interfaces' for agent card structure.
    • Removed explicit patching of 'AgentCard.model_validate' as 'ParseDict' is now used directly for deserialization.
  • tests/client/test_client_factory.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'TransportProtocol' from 'a2a.utils.constants'.
    • Modified 'base_agent_card' and related tests to use 'supported_interfaces' and 'supported_protocol_bindings' for transport configuration.
  • tests/client/test_client_task_manager.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'sample_task' to use 'TaskState.TASK_STATE_WORKING'.
    • Updated 'sample_message' to use 'Role.ROLE_USER' and Protobuf 'Part' objects.
    • Refactored tests to use 'StreamResponse' objects for processing events and updated assertions accordingly.
  • tests/client/test_errors.py
    • Updated imports to use 'jsonrpc.jsonrpc2.JSONRPC20Response'.
    • Modified 'test_repr' to reflect the direct handling of error dictionaries.
  • tests/client/test_legacy_client.py
    • Removed the legacy client test file.
  • tests/client/transports/test_grpc_client.py
    • Updated 'mock_grpc_stub' to use 'MagicMock' without a specific spec.
    • Changed imports to use Protobuf-generated types from 'a2a.types'.
    • Modified 'sample_agent_card' to use 'supported_interfaces'.
    • Updated 'grpc_transport' fixture to use 'MagicMock' for the channel.
    • Refactored fixtures for message, task, and event samples to use Protobuf objects directly.
    • Updated tests for 'send_message', 'send_message_streaming', 'get_task', 'cancel_task', 'set_task_callback', 'get_task_callback' to handle Protobuf request/response objects directly.
    • Added tests for 'list_tasks' functionality.
  • tests/client/transports/test_jsonrpc_client.py
    • Removed imports for 'A2ACardResolver' and legacy A2A type constants.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Refactored fixtures for HTTP client, agent card, and transport to align with Protobuf types.
    • Introduced 'create_send_message_request' helper for Protobuf message creation.
    • Removed 'TestA2ACardResolver' class.
    • Refactored test classes to focus on specific JSON-RPC methods and their Protobuf interactions.
    • Updated all test methods to use new Protobuf-based request/response types and JSON-RPC 2.0 structures.
    • Removed 'async_iterable_from_list' helper.
  • tests/client/transports/test_rest_client.py
    • Removed 'respx' import.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'TransportProtocol' from 'a2a.utils.constants'.
    • Modified 'mock_agent_card' fixture to use 'supported_interfaces' and 'capabilities.extended_agent_card'.
    • Updated tests for 'send_message_streaming_timeout', 'send_message_with_default_extensions', 'send_message_streaming_with_new_extensions', 'send_message_streaming_server_error_propagates' to use 'SendMessageRequest' and handle Protobuf types.
    • Updated 'get_card_with_extended_card_support_with_extensions' to use 'agent_card.capabilities.extended_agent_card' and 'get_extended_agent_card'.
  • tests/e2e/init.py
    • Added a new 'init.py' file for the e2e tests package.
  • tests/e2e/push_notifications/init.py
    • Added a new 'init.py' file for the push notifications e2e tests package.
  • tests/e2e/push_notifications/agent_app.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'test_agent_card' to use 'supported_interfaces' and 'extended_agent_card' capability.
    • Updated 'invoke' method to check for Protobuf 'Part' fields and access text directly.
  • tests/e2e/push_notifications/notifications_app.py
    • Added 'pydantic.ConfigDict' import.
    • Updated imports to use Protobuf-generated 'StreamResponse' and 'Task' from 'a2a.types.a2a_pb2', and 'google.protobuf.json_format'.
    • Modified 'Notification' model to store 'event' as a dictionary.
    • Refactored 'add_notification' to parse 'StreamResponse' and extract 'task_id' from the appropriate Protobuf field.
    • Updated the path for 'list_notifications_by_task'.
  • tests/e2e/push_notifications/test_default_push_notification_support.py
    • Updated imports to use relative paths for local modules.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'TransportProtocol' from 'a2a.utils.constants'.
    • Modified tests to use 'supported_protocol_bindings', 'Part(text=...)', 'Role.ROLE_USER', and 'CreateTaskPushNotificationConfigRequest'.
    • Adjusted assertions to handle 'StreamResponse' objects and Protobuf enum values for task states.
  • tests/e2e/push_notifications/utils.py
    • Updated 'create_app_process' to use 'multiprocessing.get_context' with 'fork' on non-Windows systems for better compatibility with FastAPI.
  • tests/extensions/test_common.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'test_find_extension_by_uri' and 'test_find_extension_by_uri_no_extensions' to use 'supported_interfaces'.
    • Updated 'test_update_extension_header_merge_with_existing_extensions' to use a 'set()' for expected extensions.
  • tests/integration/test_client_server_integration.py
    • Added import for 'google.protobuf.json_format.MessageToDict'.
    • Updated imports to use Protobuf-generated types from 'a2a.types' and 'TransportProtocol' from 'a2a.utils.constants'.
    • Added import for 'a2a.client.card_resolver.A2ACardResolver' and 'cryptography.hazmat.primitives.asymmetric.ec'.
    • Refactored task constants to use Protobuf enum values and remove 'kind' field.
    • Added 'LIST_TASKS_RESPONSE' constant.
    • Updated 'create_key_provider' signature.
    • Modified 'mock_request_handler' fixture to include 'on_list_tasks' and use Protobuf objects directly.
    • Updated 'agent_card' fixture to use 'supported_interfaces'.
    • Adjusted 'http_base_setup' to handle 'sse.AppStatus.should_exit_event' type ignore.
    • Modified 'jsonrpc_setup' and 'rest_setup' to pass the agent URL to the transport constructor.
    • Refactored streaming and blocking message tests to use 'Role.ROLE_USER', Protobuf 'Part' objects, 'SendMessageRequest', and handle 'StreamResponse'/'SendMessageResponse' objects.
    • Updated 'get_task' and 'cancel_task' tests to use 'GetTaskRequest'/'CancelTaskRequest' and directly return 'Task' Protobuf objects.
    • Added 'test_http_transport_list_tasks' and 'test_grpc_transport_list_tasks'.
    • Updated 'set_task_callback' and 'get_task_callback' tests to use 'CreateTaskPushNotificationConfigRequest'/'GetTaskPushNotificationConfigRequest' and directly return 'TaskPushNotificationConfig' Protobuf objects.
    • Modified 'resubscribe' tests to use 'SubscribeToTaskRequest' and handle 'StreamResponse' objects.
    • Updated 'get_card' and 'get_authenticated_card' tests to use 'agent_card.capabilities.extended_agent_card' and 'get_extended_agent_card'.
    • Refactored signed card tests to use 'A2ACardResolver' for initial card fetching and verification.
  • tests/integration/test_end_to_end.py
    • Added a new file for comprehensive end-to-end integration tests across all transports.
  • tests/server/agent_execution/test_context.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'mock_params' fixture to use 'SendMessageRequest'.
    • Adjusted error message assertions to match new error handling.
  • tests/server/agent_execution/test_simple_request_context_builder.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'create_sample_message' to use 'Role.ROLE_USER' and Protobuf 'Part' objects.
    • Updated 'create_sample_task' to use 'TaskState.TASK_STATE_SUBMITTED'.
    • Changed 'params' type to 'SendMessageRequest'.
  • tests/server/apps/jsonrpc/test_fastapi_app.py
    • Updated imports to use Protobuf-generated 'AgentCard' from 'a2a.types.a2a_pb2'.
    • Modified 'mock_app_params' to remove 'supports_authenticated_extended_card' attribute.
  • tests/server/apps/jsonrpc/test_jsonrpc_app.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'mock_app_params' to remove 'supports_authenticated_extended_card' attribute.
    • Updated 'IncompleteJSONRPCApp' instantiation with type ignore.
    • Refactored 'mock_handler' to return Protobuf 'Message' directly.
    • Modified 'test_app' fixture to set 'mock_agent_card.capabilities'.
    • Introduced '_make_send_message_request' helper for JSON-RPC request creation.
    • Updated tests to use the new request helper and Protobuf types.
  • tests/server/apps/jsonrpc/test_serialization.py
    • Added imports for 'google.protobuf.json_format'.
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and error types from 'a2a.server.jsonrpc_models'.
    • Introduced 'minimal_agent_card' fixture.
    • Refactored 'agent_card_with_api_key' fixture to use Protobuf types and 'CopyFrom'.
    • Updated 'test_starlette_agent_card_serialization' and 'test_fastapi_agent_card_serialization' to reflect Protobuf serialization.
    • Modified 'test_handle_invalid_json' and 'test_handle_oversized_payload' to use 'minimal_agent_card' and check error codes directly.
    • Updated 'test_handle_unicode_characters' to use 'minimal_agent_card' and Protobuf types.
    • Adjusted 'test_fastapi_sub_application' to handle injected Swagger 2.0 schema or fallback to OpenAPI 3.0+.
  • tests/server/apps/jsonrpc/test_starlette_app.py
    • Updated imports to use Protobuf-generated 'AgentCard' from 'a2a.types.a2a_pb2'.
    • Modified 'mock_app_params' to remove 'supports_authenticated_extended_card' attribute.
  • tests/server/apps/rest/test_rest_fastapi_app.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2'.
    • Modified 'agent_card' and 'streaming_agent_card' fixtures to remove 'supports_authenticated_extended_card' attribute.
    • Refactored tests for 'send_message' and streaming endpoints to use Protobuf objects directly.
  • tests/server/events/test_event_consumer.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'JSONRPCError' from 'a2a.server.jsonrpc_models'.
    • Introduced 'create_sample_message' and 'create_sample_task' helpers for Protobuf objects.
    • Refactored tests to use these helpers and handle Protobuf objects directly.
  • tests/server/events/test_event_queue.py
    • Updated imports to use Protobuf-generated types from 'a2a.types.a2a_pb2' and 'JSONRPCError' from 'a2a.server.jsonrpc_models'.
    • Introduced 'create_sample_message' and 'create_sample_task' helpers for Protobuf objects.
    • Refactored tests to use these helpers and handle Protobuf objects directly, including type ignore for queue methods.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/linter.yaml
    • .github/workflows/unit-tests.yml
    • .github/workflows/update-a2a-types.yml
  • Ignored by pattern: CHANGELOG.md (1)
    • CHANGELOG.md
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.

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 is an extensive and well-executed refactoring to migrate the project's data models from Pydantic to Protobuf. The changes are consistent across the entire codebase, including client, server, and test files. This move simplifies the architecture by removing the proto_utils conversion layer, improves type safety, and aligns the project with the A2A specification as the single source of truth for data models. The automation of code generation via buf and hatch build hooks is a great addition. The cleanup of legacy clients and scripts is also a welcome improvement. Overall, this is a high-quality pull request that significantly improves the maintainability and robustness of the SDK. The one minor issue identified is still valid.

Comment thread src/a2a/utils/task.py
missing_padding = len(encoded_str) % 4
if missing_padding:
encoded_str += '=' * (4 - missing_padding)
print(f'input: {encoded_str}')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

This print statement appears to be a leftover from debugging and should be removed.

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.

[Bug]: Align send_message signature for BaseClient and Client

5 participants