Skip to content

INVALID_ARGUMENT in VertexAiSessionService during A2A call due to UUID session ID #2727

@ftnext

Description

@ftnext

Describe the bug
A 400 INVALID_ARGUMENT error with the message "Invalid Session resource name" occurs when an agent using VertexAiSessionService is called from another agent via A2A (Agent-to-Agent) communication.
This issue does not occur when interacting with the agent without using A2A.

To Reproduce
Steps to reproduce the behavior:

  1. Create an agent that utilizes VertexAiSessionService.
  2. From a different agent, attempt to connect to the first agent using A2A.
  3. Initiate a conversation.
  4. See the following error:
400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'List of found errors:\t1.Field: name; Message: Invalid Session resource name.\t', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'name', 'description': 'Invalid Session resource name.'}]}]}}}

Expected behavior
The A2A connection should be established successfully without any errors, and a new session should be created in the VertexAiSessionService-backed agent.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Debian 13 (Using python docker image)
  • Python version(python -V): 3.13.7
  • ADK version(pip show google-adk): 1.12.0

Model Information:
gemini-2.5-pro

Additional context
The root cause appears to be a mismatch in session ID formats.

Based on the source code, the A2A SendMessageRequest in remote_a2a_agent.py uses a UUID as the session ID.

a2a_request = SendMessageRequest(
id=str(uuid.uuid4()),

return SendMessageRequest(
id=str(uuid.uuid4()),

However, when the receiving agent's VertexAiSessionService tries to create the session, it passes this UUID directly to the Vertex AI API.

get_session_api_response = await api_client.async_request(
http_method='GET',
path=f'reasoningEngines/{reasoning_engine_id}/sessions/{session_id}',
request_dict={},
)

The Vertex AI API seems to expect a numeric ID for the session resource name, not a UUID. This causes the "Invalid Session resource name" error.

This can be verified by sending a request with a UUID-formatted session ID directly to the Vertex AI API, which reproduces the error:

curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://<location>-aiplatform.googleapis.com/v1beta1/projects/<our-project>/locations/<location>/reasoningEngines/<engine-id>/sessions/7e56773c-8968-4fe5-97c0-cc8d14e200e1"
{
  "error": {
    "code": 400,
    "message": "List of found errors:\t1.Field: name; Message: Invalid Session resource name.\t",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "name",
            "description": "Invalid Session resource name."
          }
        ]
      }
    ]
  }
}

Metadata

Metadata

Assignees

Labels

a2a[Component] This issue is related a2a support inside ADK.needs review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions