-
-
Notifications
You must be signed in to change notification settings - Fork 69.7k
Gemini provider: function_response.name empty on session replay → 400 INVALID_ARGUMENT #46717
Copy link
Copy link
Open
Description
Bug
When using a Gemini-backed agent (google-generative-ai provider, gemini-3.1-pro-preview), tool results are serialized into the session history with an empty name field in the function_response part. On session replay, the Google API rejects the request:
GenerateContentRequest.contents[2].parts[0].function_response.name: Name cannot be empty.
Reproduction
- Configure an agent with
model: google/gemini-3.1-pro-preview - Send a message that triggers a tool call (e.g. 'read file X')
- First response works fine
- Send any follow-up message → 400 error
- Inspect the session JSONL: the
toolResultentry hastoolName: undefinedor missing entirely
Impact
- Every Gemini agent with tools enabled becomes permanently broken after first tool call
- Only fix is wiping the session file (we've done this 7+ times in 2 weeks)
- Re-corrupts immediately on next tool use
Environment
- OpenClaw 2026.3.13 (61d171a)
- @google/genai SDK (bundled)
- Model: gemini-3.1-pro-preview
- macOS arm64
Expected
The function_response.name should be populated from the preceding functionCall in the conversation, matching the tool name that was called.
Workaround
Currently wiping session files, but corruption recurs on every tool call. Only real workaround is disabling tools for the agent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.