fix(sessions): drop unsupported part_metadata before Vertex appendEvent#6024
fix(sessions): drop unsupported part_metadata before Vertex appendEvent#6024rynecheow wants to merge 4 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @rynecheow, thank you for creating this PR! We noticed that the Google Contributor License Agreement (CLA) check has failed for this pull request. As part of our contribution guidelines, all submissions must be accompanied by a signed CLA before we can review and merge your changes. Please visit https://cla.developers.google.com/ to view your current agreements or sign a new one. Once signed, the CLA check status should automatically update. Thank you for your contribution and helping us improve the ADK! |
ee1b928 to
e03c5b2
Compare
⛔ Compliance Refusal: Contributor License Agreement (CLA) Verification FailedWe cannot perform the analysis, fetch the code diff, or conduct any triage operations for PR #6024 at this time. Reason:The contributor (@rynecheow) has not signed the Google Contributor License Agreement (CLA). According to the established project contribution policies:
Next Steps:The author needs to visit Google CLA Portal to view or sign the Contributor License Agreement. Once the agreement is signed, the status of the PR's CLA check will update, and we will be able to proceed with the analysis. |
⛔ Compliance Refusal: Contributor License Agreement (CLA) Verification FailedWe cannot perform the analysis, fetch the code diff, or conduct any triage operations for PR #6024 at this time. Reason:The contributor (@rynecheow) has not signed the Google Contributor License Agreement (CLA). According to the project contribution guidelines and legal compliance policy:
Next Steps:The contributor needs to visit the Google CLA Portal to review and sign the agreement. Once the agreement is signed and the status is updated to Turn Summary
|
google.genai Part.part_metadata is a Gemini Developer API-only field (the model
path already guards it in genai's _Part_to_vertex). VertexAiSessionService.
append_event serialised it into both the `content` and `raw_event` payloads, and
the Vertex AI Agent Engine Sessions appendEvent API rejects it with
400 INVALID_ARGUMENT ('Unknown name "part_metadata" at event.content.parts[0]'),
crashing every turn for agents that carry part_metadata (e.g. ADK's A2A part
converter copies inbound A2A part metadata into Part.part_metadata).
Strip part_metadata from the serialised content (and raw_event content) before
the appendEvent call. Adds regression tests for both the stripped append payload
and the read-back round-trip via get_session.
Fixes google#6014
e03c5b2 to
778eb1b
Compare
|
I will view the Title: fix(sessions): drop unsupported part_metadata before Vertex appendEvent Executive Summary
Detailed Findings & Analysis1. Objectives & Impact ("What does it do?")
2. Justification & Value ("Is it a valid and useful change?")
3. Principle & Style Alignment Checklist ("Does it follow rules?")
Turn Summary
|
|
I have completed a thorough, read-only architectural and style review of Pull Request #6024. The full, structured findings have been published to the interactive artifact: Key Highlights
RecommendationApprove — The PR is of exceptionally high quality, extremely localized in risk, and directly resolves a business-critical blocker regression. No requests for changes or modifications are necessary. |
Description
google.genaiPart.part_metadatais a Gemini Developer API-only field — the model path already guards it in genai's_Part_to_vertex(raises for Vertex). ButVertexAiSessionService.append_eventserialised it into both thecontentandraw_eventpayloads, and the Vertex AI Agent Engine SessionsappendEventAPI rejects it:This crashes every turn for agents whose events carry
part_metadata. A common trigger: ADK's own A2A part converter (a2a/converters/part_converter.convert_a2a_part_to_genai_part) copies inbound A2A part metadata intoPart.part_metadata, so any A2A-fronted agent usingVertexAiSessionService(durable Agent Engine sessions) on Vertex fails on the first turn.Fix
Add
_drop_vertex_unsupported_part_fields, which removespart_metadata(tolerant of thepartMetadataalias) from the serialised content, and apply it to bothconfig['content']andconfig['raw_event']['content']before theappendEventcall. This mirrors the existing genai_Part_to_vertexguard for the model path.Testing
test_append_event_strips_unsupported_part_metadataassertspart_metadatais absent from both thecontentandraw_eventpayloads while the part text is preserved. Verified it fails without the fix (the field is present in the dump pre-strip).tests/unittests/sessions/test_vertex_ai_session_service.pysuite passes (35 tests).isort+pyinkapplied per repo config.Fixes #6014