Skip to content

ci(python): run a2ui-agent-sdk tests on a2a-sdk 1.x - #2363

Open
WillBeebe wants to merge 8 commits into
a2ui-project:mainfrom
WillBeebe:feat/a2a-sdk-1x-ci
Open

ci(python): run a2ui-agent-sdk tests on a2a-sdk 1.x#2363
WillBeebe wants to merge 8 commits into
a2ui-project:mainfrom
WillBeebe:feat/a2a-sdk-1x-ci

Conversation

@WillBeebe

Copy link
Copy Markdown

Stacked on #2337. Only the last commit is new (ci(python): run a2ui-agent-sdk tests on a2a-sdk 1.x). Review against WillBeebe:feat/a2a-sdk-1x-part-types if this PR still contains #2337.

Why

#2337 widens the published a2ui-agent-sdk pin to a2a-sdk>=0.3.0,<2, but workspace CI stays on 0.3 (constraint-dependencies plus sample packages that still pin <0.4). The IS_A2A_V1 branch of _compat is untested in CI.

A full clone of python-ci cannot uv sync --all-packages on 1.x: other workspace members (e.g. file-upload-summarizer) still require a2a-sdk<0.4.

What

Sibling job Python CI (a2a-sdk 1.x):

  • Isolated venv (install from /tmp so workspace constraint-dependencies do not apply)
  • a2ui-core + a2ui-agent-sdk + a2a-sdk>=1.0.0,<2
  • pytest agent_sdks/python/a2ui_agent/tests/a2a — the helpers that go through _compat

Default python-ci is unchanged (0.3, full workspace).

Also: part_metadata no longer calls HasField on the protobuf map (raises ValueError on 1.x).

Locally: 10 passed on a2a-sdk 1.1.2 (IS_A2A_V1=True).

Out of scope

  • Sample Part.root rewrites (follow-up)
  • tests/adk / tests/conformance still import 0.3 DataPart at test-construction time
  • Lifting workspace constraint-dependencies

WillBeebe and others added 6 commits August 19, 2026 14:52
ADK 2.x already pins google-adk 2.3 and accepts a2a-sdk <2, but
a2ui-agent-sdk still constructed pydantic Part(root=DataPart) and
called RequestContext.add_activated_extension. Those APIs are gone
in a2a-sdk 1.x (protobuf Part + call_context.state).

Add version-agnostic helpers so create_a2ui_part, is_a2ui_part,
get_a2ui_data, extract_user_action, and try_activate_a2ui_extension
work on both generations. Widen the published a2a-sdk pin to <2
while keeping the workspace lock on 0.3 until samples migrate.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: william <651833+WillBeebe@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: william <651833+WillBeebe@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: william <651833+WillBeebe@users.noreply.github.com>

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

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.

Code Review

This pull request introduces version-agnostic compatibility helpers in _compat.py to support both a2a-sdk 0.3.x and 1.x. It updates the SDK to use these helpers for creating and managing parts and agent extensions, widens the a2a-sdk dependency range, and adds comprehensive unit tests. One high-severity issue was identified in _compat.py where calling MessageToDict on part.metadata (a protobuf map container) will raise a TypeError at runtime; the reviewer suggested converting it directly using dict(part.metadata) instead.

Comment on lines +100 to +103
from google.protobuf.json_format import MessageToDict

# metadata is a protobuf map; HasField() raises ValueError on maps.
return MessageToDict(part.metadata) if part.metadata else {}

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.

high

Calling MessageToDict on part.metadata (which is a protobuf map container, not a Message instance) will raise a TypeError at runtime. Since part.metadata is a standard protobuf map of string to string, you can simply convert it to a plain Python dictionary using dict(part.metadata).

Suggested change
from google.protobuf.json_format import MessageToDict
# metadata is a protobuf map; HasField() raises ValueError on maps.
return MessageToDict(part.metadata) if part.metadata else {}
return dict(part.metadata)

@WillBeebe

Copy link
Copy Markdown
Author

Stacked on #2337. Sample Part.root follow-up: #2364.

MessageToDict(part.metadata) is enough; HasField on a map raises
ValueError in the Python protobuf runtime.

Signed-off-by: william <651833+WillBeebe@users.noreply.github.com>
Add a sibling Python CI job that installs only a2ui-agent-sdk with
a2a-sdk>=1 in an isolated venv (workspace members still pin <0.4, so
uv sync --all-packages cannot resolve 1.x). Run tests/a2a, which go
through _compat.

Also stop calling HasField on protobuf map metadata; that raises
ValueError on a2a-sdk 1.x.

Signed-off-by: william <651833+WillBeebe@users.noreply.github.com>
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.

1 participant