Repository navigation
Conversation
… clients The Lit shell's A2UIClient and the React shell's A2A middleware set `mimeType` on the data part itself, beside `kind` and `data`, and cast the object to Part to get past the type. An A2A 0.3 DataPart has no such field, and the extension specs put the MIME type in the part's metadata. The Python a2a-sdk drops the unknown field when it parses the message, so is_a2ui_part returns False for every client event these shells send. Move it to `metadata.mimeType`, as the Angular client and the Lit shell's own middleware do, and drop the casts so the compiler checks the part's shape. The Lit client's useStreaming part takes the same change.
|
Hi @retz8, Thank you for raising the pr to fix the issue. We have verified the pr and it does resolve the issue. I will escalate this to team to review. Thank you for your patience and understanding. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the structure of data parts in samples/client/lit/shell/client.ts and samples/client/react/shell/middleware/a2a.ts by nesting the mimeType property inside a new metadata object and removing the now unused Part type assertions and imports. As there are no review comments, I have no feedback to provide.
|
From triage bot, analysis: For humansTL;DR Summary: Targeted issues: Suggestion:
As the author of #4158,
To adjust the analysis and apply its suggestion, run in your a2ui checkout: tools/internal/triage/triage_ui.sh https://github.com/a2ui-project/a2ui/pull/3602For softwareThis analysis is auto-created to help humans to triage this item. Please, do not treat it as a team decision. 🤖 Agent-generated |
|
Thanks for the fix. Assigning this PR to |
…mime-type-metadata
|
Thanks @polina-c! In case it helps: #4158 and the draft #4325 conflict with this PR in three places in the Lit shell's |
gspencergoog
left a comment
There was a problem hiding this comment.
This change moves the A2A DataPart MIME type from a top-level mimeType field into metadata: {mimeType: ...} in samples/client/lit/shell/client.ts and samples/client/react/shell/middleware/a2a.ts, and removes the as Part casts that previously hid the schema mismatch from TypeScript. It also removes the now-unused Part import from samples/client/react/shell/middleware/a2a.ts while retaining Part in samples/client/lit/shell/client.ts where let parts: Part[] = [] uses it.
The updated literals match the @a2a-js/sdk DataPart type definition and downstream A2A consumers such as is_a2ui_part in python/a2ui_a2a. Local tsc/eslint checks were skipped in the ephemeral checkout because node_modules is not installed there.
🤖 Agent-generated
…mime-type-metadata
Description
The Lit shell's
A2UIClientand the React shell's A2A middleware setmimeTypeon the data part itself, not in its metadata. The Pythona2a-sdkdrops that field, sois_a2ui_partreturnsFalsefor every client event these shells send. Full mechanism and reproduction in the issue. Fixes #3601.Fix
samples/client/lit/shell/client.ts: both client-event parts, and the{useStreaming: false}part, which setmimeType: 'application/json'the same way.samples/client/react/shell/middleware/a2a.ts: the client-event part. The file no longer importsPart.The parts now match the extension specs' examples, the Angular client and the Lit shell's own middleware. The
as Partcasts are gone, so the compiler checks the part's shape. AmimeTypeon the part now fails withTS2353: Object literal may only specify known properties, and 'mimeType' does not exist in type 'DataPart'.The sample agents find events by the keys inside
data, so they behave as before.Tests
Neither shell has a test that covers sending. I ran an
a2a-sdk0.3.25 agent onlocalhost:10002that logs each DataPart it receives. I sent one client event through the Lit shell'sA2UIClientin Node and POSTed one to the React shell's/a2aon the Vite dev server:mainmetadataisNone;is_a2ui_partisFalsemetadatais{"mimeType": "application/a2ui+json"};is_a2ui_partisTrueuseStreamingpartmetadataisNonemetadatais{"mimeType": "application/json"}metadataisNone;is_a2ui_partisFalsemetadatais{"mimeType": "application/a2ui+json"};is_a2ui_partisTrueOn this branch:
tsc --noEmitpasses for both shells (Lit after building@a2ui/lit).vitest run --environment jsdom tests/smoke-test.spec.ts) passes.no-explicit-anywarnings, on lines this PR does not touch, remain.Pre-launch Checklist
One time:
For this PR:
If you need help, consider asking for advice on the discussion board.