fix(shell-client): handle multiple A2A response formats in orchestrator #335
+47
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix A2UI Shell Client Response Parsing for Orchestrator Agent
Problem
The A2UI shell client (
samples/client/lit/shell/client.ts) was not displaying responses from the orchestrator agent. When users submitted queries, the backend would process requests successfully and return A2UI components, but the UI would remain on the input form without rendering the results.Root Cause
The client's response parsing logic only checked for parts in
result.status.message.parts, which is used for streaming/task-based responses. However, the orchestrator agent returns responses in a different format using:result.artifacts[].parts- for blocking responsesresult.history[]- containing message history including agent responsesThis mismatch meant that valid A2UI responses were being discarded, resulting in an empty messages array and no UI rendering.
Solution
Updated the
send()method insamples/client/lit/shell/client.tsto handle multiple A2A response formats:result.status.message.partsfor streaming responsesresult.artifacts[].partsfor blocking responsesresult.history[]for agent responses in message historyThe fix also adds comprehensive logging to help debug response parsing issues in development.
Changes Made
File:
samples/client/lit/shell/client.tsThe response parsing now checks three locations for A2UI message parts:
Debug console.log statements have been added to aid troubleshooting during development.
Testing
Setup
Start all required agents:
Start the shell client:
cd samples/client/lit/shell npm install npm run devOpen browser to
http://localhost:5173/Test Cases
✅ Restaurant Query
✅ Contact Query
✅ Dashboard Query
Impact
samples/client/lit/shell/client.ts)Additional Notes
Debug Logging
The fix includes console.log statements for development debugging. These are useful for troubleshooting response parsing issues and can be:
if (import.meta.env.DEV)conditionals if preferredResponse Format Documentation
This fix highlights the need for clearer documentation on A2A response formats. The protocol supports multiple response structures depending on agent implementation and configuration (blocking vs streaming, task-based vs direct).
Checklist
Related Issues
This fix addresses the issue where the orchestrator agent sample would process requests successfully (as shown in backend logs) but the UI would not render the A2UI components returned by the subagents.
Fixes: Orchestrator agent UI rendering issue