Skip to content

Multiple function_response in single API call causes "Proto field is not repeating" error #67

@lina-bmx

Description

@lina-bmx

Describe the bug
When the Gemini model returns multiple function calls in a single
response, the ADK fails to send the combined function responses back
to the API. The Gemini API rejects the payload with a protobuf
serialization error: "Proto field is not repeating, cannot start
list."

To Reproduce
Steps to reproduce the behavior:

  1. Install @google/adk@0.2.4
  2. Create an agent with multiple FunctionTool tools
  3. Send a prompt that causes Gemini to call 2+ tools simultaneously
  4. All tools execute successfully and return results
  5. See error:
  400 Invalid JSON payload received. Unknown name "response" at        
  'contents[2].parts[0].function_response': Proto field is not         
  repeating, cannot start list.        

Expected behavior
The ADK should properly format multiple function responses in a way
the Gemini API accepts, allowing the model to see all tool results
and generate a combined response.

Screenshots
N/A - error appears in console logs

Desktop (please complete the following information):

  • OS: Windows 10
  • TS version/environment: TypeScript 5.x, Node.js v22.20.0
  • ADK version: @google/adk@0.2.4

Additional context

  • Single tool calls work fine - issue only occurs with 2+
    simultaneous tool responses
  • Tools execute successfully; the failure is in sending responses
    back to Gemini
  • Model: gemini-3-flash-preview, Backend: VERTEX_AI
  • Related Python ADK issue:
    Add enable_parallel_tool_execution flag to LlmAgent adk-python#1076
  • Workaround: Catch error and return fallback message, but model
    never sees tool results

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions