From 1516aa724d7c6bc29319df0059cda2f11441edf9 Mon Sep 17 00:00:00 2001 From: Marcos Benedicto Date: Sun, 3 May 2026 15:02:27 +0200 Subject: [PATCH 1/2] fix(proto-utils): use FieldDescriptor.is_repeated instead of removed .label protobuf 7.x dropped FieldDescriptor.label from both upb and pure-Python backends, breaking all three call sites in proto_utils.py at runtime: AttributeError: 'FieldDescriptor' object has no attribute 'label' The code already had TODO comments referencing #1011 with the exact intended fix ("Replace deprecated `field.label` with `field.is_repeated` once the minimum protobuf version requirement is bumped"). Since the package's protobuf>=5.29.5 floor is well past the version that exposed both attributes, we can land the swap now. Three call sites: - parse_query_params_to_proto (line 180): body request parsing - _check_required_field_violation (line 217): required-field validator - _recurse_validation (line 261): nested-message validator Without this fix, every JSON-RPC method that runs through the request handler raises AttributeError before the agent executor is ever called. Closes #1011 --- src/a2a/utils/proto_utils.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/a2a/utils/proto_utils.py b/src/a2a/utils/proto_utils.py index b191f98e0..e6f623ff7 100644 --- a/src/a2a/utils/proto_utils.py +++ b/src/a2a/utils/proto_utils.py @@ -174,10 +174,7 @@ def parse_params(params: QueryParams, message: ProtobufMessage) -> None: field = fields[k] v_list = params.getlist(k) - # TODO(https://github.com/a2aproject/a2a-python/issues/1011): Replace - # deprecated `field.label` with `field.is_repeated` once the minimum - # protobuf version requirement is bumped. - if field.label == FieldDescriptor.LABEL_REPEATED: + if field.is_repeated: accumulated: list[Any] = [] for v in v_list: if not v: @@ -211,10 +208,7 @@ def _check_required_field_violation( ) -> ValidationDetail | None: """Check if a required field is missing or invalid.""" val = getattr(msg, field.name) - # TODO(https://github.com/a2aproject/a2a-python/issues/1011): Replace - # deprecated `field.label` with `field.is_repeated` once the minimum - # protobuf version requirement is bumped. - if field.label == FieldDescriptor.LABEL_REPEATED: + if field.is_repeated: if not val: return ValidationDetail( field=field.name, @@ -255,10 +249,7 @@ def _recurse_validation( return errors val = getattr(msg, field.name) - # TODO(https://github.com/a2aproject/a2a-python/issues/1011): Replace - # deprecated `field.label` with `field.is_repeated` once the minimum - # protobuf version requirement is bumped. - if field.label != FieldDescriptor.LABEL_REPEATED: + if not field.is_repeated: if msg.HasField(field.name): sub_errs = _validate_proto_required_fields_internal(val) _append_nested_errors(errors, field.name, sub_errs) From 2bb8a64c6b1b9b8ee1d617f7bec664e0e357fa7d Mon Sep 17 00:00:00 2001 From: Marcos Benedicto Date: Sun, 3 May 2026 15:14:53 +0200 Subject: [PATCH 2/2] ci: retrigger CI to confirm cross_version test flake on 3.11