Skip to content

fix(a2a-pb): keep the REQUIRED fields of ListTasksResponse and AgentCard - #446

Merged
muscariello merged 1 commit into
stack/06-list-tasks-timestamp-inclusivefrom
stack/07-protojson-required-fields
Nov 2, 2026
Merged

muscariello merged 1 commit into
stack/06-list-tasks-timestamp-inclusivefrom
stack/07-protojson-required-fields

Conversation

@muscariello

Copy link
Copy Markdown
Member

Fixes #415. Replaces #416. Stacked on #445: review only the last commit.

Cause: proto3-JSON omits default values, so an empty ListTasks page lost tasks and totalSize, and an agent card without skills or modes lost skills, defaultInputModes, defaultOutputModes and an empty description. §5.7 says REQUIRED fields MUST be present.

Fix: ListTasksResponse::normalize_json, which already restores nextPageToken, now restores all four REQUIRED fields through a small insert_required helper, and AgentCard gets the same for its REQUIRED top-level fields. Values that are present are never touched, and decoding is unchanged. Nested messages, such as an AgentSkill with no tags, are not covered.

Tests: two new tests in protojson_conv.rs: an empty ListTasksResponse keeps all four fields, and an AgentCard with empty skills, modes and description keeps every REQUIRED key and round-trips.

Unproven: the failures on main and the helloworld-server output quoted in #416 were not run locally. CI is the check.

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@muscariello
muscariello force-pushed the stack/07-protojson-required-fields branch from c089c58 to dbb638a Compare November 2, 2026 12:00
@muscariello
muscariello force-pushed the stack/07-protojson-required-fields branch from dbb638a to a0e2f6d Compare November 2, 2026 12:02
proto3-JSON leaves out fields at their default, so an empty ListTasks page
came out as {"nextPageToken":"","pageSize":50} and an extended card without
skills or modes lost skills, defaultInputModes and defaultOutputModes.
Section 5.7 says REQUIRED fields MUST be present. The ListTasksResponse
normalisation that already restores nextPageToken now restores tasks,
pageSize and totalSize too, and AgentCard gets the same for its REQUIRED
top-level fields.

Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
@muscariello
muscariello force-pushed the stack/07-protojson-required-fields branch from a0e2f6d to 42525ff Compare November 2, 2026 14:28
@muscariello
muscariello removed this pull request from stack #442 November 2, 2026 15:00
@muscariello
muscariello added this pull request to stack #456 November 2, 2026 15:01
@muscariello
muscariello added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 1d12a9c Nov 2, 2026
43 of 45 checks passed
@muscariello
muscariello deleted the stack/07-protojson-required-fields branch November 2, 2026 17:44
@github-actions github-actions Bot mentioned this pull request Nov 2, 2026
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]: ProtoJSON drops REQUIRED fields left at their default (empty ListTasks, extended card without skills)

3 participants