bump google.golang.org/adk from v0.4.0 to v0.5.0#1954
Conversation
ADK v0.5.0 changed how the A2A executor structures artifacts: partial streaming events now produce a separate artifact with a DataPart LastChunk marker. Updated and simplified the A2A e2e tests to handle the new multi-artifact response format by extracting a sendA2AMessage helper and filtering for text parts across all artifacts. Also fixed startA2AServer to use a context-aware HTTP request. Assisted-By: cagent
There was a problem hiding this comment.
Review Summary
Assessment: 🔴 CRITICAL
This PR updates the ADK dependency to v0.5.0 and refactors the A2A tests to handle the new multi-artifact response format. However, the new test validation logic has critical issues that could cause test failures with streaming partial responses.
Critical Issues Found:
- Test assertions assume all text parts contain complete data, but streaming partial responses may produce empty or incomplete text parts
- Final text validation assumes the last text part is the final response, which may not be true with LastChunk markers
Findings:
- 🔴 1 CRITICAL issue
- 🟡 1 NOTABLE issue
| texts := resp.textParts() | ||
| require.NotEmpty(t, texts) | ||
| for _, text := range texts { | ||
| assert.Equal(t, "4", text) |
There was a problem hiding this comment.
🔴 CRITICAL: Test assertion fails on partial streaming artifacts
The test loops over all text parts and asserts that each equals '4':
for _, text := range texts {
assert.Equal(t, "4", text)
}With the new multi-artifact format where streaming partial responses produce separate artifacts with DataPart LastChunk markers, intermediate text parts may contain partial or empty content that doesn't match '4'. This will cause the test to fail on streaming partial responses.
The old code checked specific indices (Parts[0] and Parts[1]). The new code should either:
- Check only the final aggregated text
- Filter out partial/empty streaming artifacts before assertion
- Verify the complete set of expected values rather than assuming each part equals '4'
|
|
||
| texts := resp.textParts() | ||
| require.NotEmpty(t, texts) | ||
| assert.Contains(t, texts[len(texts)-1], "Hello") |
There was a problem hiding this comment.
🟡 NOTABLE: Incorrect final text validation with multi-artifact format
The test uses texts[len(texts)-1] to assert the final response:
assert.Contains(t, texts[len(texts)-1], "Hello")With the new multi-artifact format, the last text part might be an empty DataPart LastChunk marker rather than the actual response content. This means the assertion could check an empty string instead of the actual final answer.
Consider:
- Aggregating all non-empty text parts
- Verifying the complete response is present somewhere in the artifacts
- Filtering out LastChunk markers before validation
ADK v0.5.0 changed how the A2A executor structures artifacts: partial streaming events now produce a separate artifact with a DataPart LastChunk marker.
Changes
google.golang.org/adkfrom v0.4.0 to v0.5.0sendA2AMessagehelper to reduce test boilerplatestartA2AServerto use a context-aware HTTP requestTesting