Skip to content

A2A + VertexAiSessionService: part_metadata in event content rejected by Agent Engine Sessions appendEvent (400 INVALID_ARGUMENT) — regression in 2.2.0 #6014

@rynecheow

Description

@rynecheow

Environment

  • google-adk 2.2.0
  • google-genai 2.8.0
  • Vertex backend (GOOGLE_GENAI_USE_VERTEXAI=TRUE), durable sessions via VertexAiSessionService (Agent Engine)
  • Agent exposed as an A2A server; the A2A client sends message parts that carry metadata

Symptom

Every turn fails while handling the A2A request:

400 INVALID_ARGUMENT. Invalid JSON payload received.
Unknown name "part_metadata" at 'event.content.parts[0]': Cannot find field.

Root cause

  • a2a/converters/part_converter.convert_a2a_part_to_genai_part copies the inbound A2A part's metadata into genai.types.Part.part_metadata.
  • The resulting event is persisted via VertexAiSessionService.append_event, which serializes part_metadata (snake_case) into the Sessions request; the Agent Engine Sessions API schema has no such field → 400, and the turn aborts.
  • This is consistent with genai's own contract that part_metadata is "not supported in Vertex AI" — _Part_to_vertex raises on it for generateContent — but the session-append path does not strip it.

Expected

part_metadata should not reach Vertex / Agent Engine. Either don't populate it from A2A metadata when running on Vertex, or strip it before appendEvent serialization (mirroring _Part_to_vertex).

Regression

Works on google-adk 2.1.0; breaks after upgrading to 2.2.0.

Metadata

Metadata

Labels

request clarification[Status] The maintainer need clarification or more information from the authorservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etcv2Affects only 2.0 version

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions