Skip to content

chore: incorporate latest proto changes (blocking -> return_immediately)#810

Merged
ishymko merged 1 commit into1.0-devfrom
ishymko/blocking-rename
Mar 11, 2026
Merged

chore: incorporate latest proto changes (blocking -> return_immediately)#810
ishymko merged 1 commit into1.0-devfrom
ishymko/blocking-rename

Conversation

@ishymko
Copy link
Copy Markdown
Member

@ishymko ishymko commented Mar 11, 2026

Original spec PR: a2aproject/A2A#1507.

Required a bunch of inversions including compat conversion updates. The gotcha here is that 0.3 SDK already uses blocking mode by default (although it's not according to the spec), so this spec change is about applying a de-facto standard.

@ishymko ishymko force-pushed the ishymko/blocking-rename branch 3 times, most recently from a99ea02 to 4f7d4f7 Compare March 11, 2026 12:31
@ishymko ishymko marked this pull request as ready for review March 11, 2026 12:31
@ishymko ishymko requested a review from a team as a code owner March 11, 2026 12:31
@ishymko ishymko requested a review from bartek-w March 11, 2026 12:32
@ishymko ishymko changed the title chore: incorporate latest proto changes chore: incorporate latest proto changes (blocking -> return_immediately) Mar 11, 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 incorporates recent protobuf specification changes, specifically renaming the 'blocking' field to 'return_immediately' within the 'SendMessageConfiguration'. This change, while a simple rename, involves an inversion of the field's semantic meaning, requiring careful updates across the client, server, and compatibility layers. The goal is to align the SDK with the de-facto standard already in use by the 0.3 SDK, ensuring consistency and clarity in how message sending behavior is configured.

Highlights

  • Protobuf Field Renaming: The 'blocking' field in 'SendMessageConfiguration' has been renamed to 'return_immediately' to better reflect its behavior, with an inverted meaning (i.e., 'blocking=True' is now 'return_immediately=False').
  • Client-Side Logic Update: The client-side '_apply_client_config' method was updated to use the new 'return_immediately' field, ensuring correct behavior when 'polling' is enabled.
  • Compatibility Layer Adjustments: The v0.3 compatibility conversion logic ('to_core_send_message_configuration' and 'to_compat_send_message_configuration') was updated to correctly map the old 'blocking' field to the new 'return_immediately' field, handling the inversion of meaning.
  • Server-Side Request Handling: The 'on_message_send' method in the default request handler was modified to interpret the 'return_immediately' field for determining blocking behavior.
  • Test Suite Refinement: All relevant unit, integration, and end-to-end tests were updated to reflect the protobuf field change and ensure the new logic functions as expected.
  • Proto Generation Update: The 'buf.gen.yaml' configuration was updated to reference the 'main' branch of the 'a2aproject/A2A' repository for proto generation.
Changelog
  • buf.gen.yaml
    • Updated the 'ref' for proto generation to 'main'.
  • src/a2a/client/base_client.py
    • Modified '_apply_client_config' to use 'request.configuration.return_immediately' instead of 'request.configuration.blocking'.
  • src/a2a/compat/v0_3/conversions.py
    • Removed default 'blocking=True' assignment in 'to_core_send_message_configuration'.
    • Updated 'core_config.blocking = compat_config.blocking' to 'core_config.return_immediately = not compat_config.blocking'.
    • Updated 'blocking=core_config.blocking' to 'blocking=not core_config.return_immediately' in 'to_compat_send_message_configuration'.
    • Removed explicit 'core_req.configuration.blocking = True' default in 'to_core_send_message_request'.
  • src/a2a/server/request_handlers/default_request_handler.py
    • Changed the logic for determining 'blocking' from 'params.configuration.blocking' to 'not params.configuration.return_immediately'.
  • src/a2a/types/a2a_pb2.py
    • Updated the serialized protobuf descriptor to reflect the 'blocking' to 'return_immediately' field rename.
  • src/a2a/types/a2a_pb2.pyi
    • Updated the Python type stub for 'SendMessageConfiguration' to rename the 'blocking' field to 'return_immediately' and adjust its type hint.
  • tests/client/test_base_client.py
    • Updated 'SendMessageConfiguration' instantiations in test cases to use 'return_immediately=True' instead of 'blocking=False', and adjusted assertions accordingly.
  • tests/compat/v0_3/test_conversions.py
    • Removed 'blocking=True' from 'v10_expected' in 'test_send_message_configuration_conversion'.
    • Removed 'blocking=True' from 'v10_expected' in 'test_send_message_configuration_conversion_minimal'.
    • Removed 'blocking=True' from 'SendMessageConfiguration' in 'test_send_message_request_conversion'.
    • Updated 'test_to_core_send_message_request_no_configuration' to assert 'not core_req.HasField('configuration')' instead of 'core_req.configuration.blocking is True'.
  • tests/compat/v0_3/test_grpc_handler.py
    • Updated 'SendMessageConfiguration' in test cases to use 'return_immediately=True' instead of 'blocking=False'.
  • tests/e2e/push_notifications/test_default_push_notification_support.py
    • Adjusted end-to-end tests to remove explicit 'blocking' configuration, relying on the new default.
  • tests/integration/test_end_to_end.py
    • Removed 'blocking=True' from 'SendMessageConfiguration' in 'test_end_to_end_send_message_blocking'.
    • Updated 'SendMessageConfiguration' to use 'return_immediately=True' instead of 'blocking=False' in 'test_end_to_end_send_message_non_blocking'.
  • tests/server/request_handlers/test_default_request_handler.py
    • Updated 'SendMessageConfiguration' to use 'return_immediately=True' instead of 'blocking=False' in 'test_on_message_send_with_push_notification_in_non_blocking_request' and 'test_on_message_send_non_blocking'.
    • Removed 'blocking=True' from 'SendMessageConfiguration' in 'test_on_message_send_limit_history' and 'test_on_get_task_limit_history'.
Activity
  • No specific activity (comments, reviews, approvals, etc.) has been recorded for this pull request yet.
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 pull request correctly implements the change from blocking to return_immediately across the codebase, including the necessary logic inversions. The updates are consistent in the client, server, compatibility layer, and tests. The change to pin the proto dependency to main is also appropriate for pulling in these upstream changes. I have one minor suggestion to improve code conciseness.

Comment thread src/a2a/server/request_handlers/default_request_handler.py
Comment thread tests/compat/v0_3/test_conversions.py Outdated
@ishymko ishymko force-pushed the ishymko/blocking-rename branch from 4f7d4f7 to bec4728 Compare March 11, 2026 14:09
@ishymko ishymko merged commit 73a2dcf into 1.0-dev Mar 11, 2026
9 checks passed
@ishymko ishymko deleted the ishymko/blocking-rename branch March 11, 2026 14:11
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.

2 participants