Skip to content

[Go] Google GenAI: tool response messages rejected with invalid role error #4694

@yesudeep

Description

@yesudeep

Summary

The Go Google GenAI plugin fails "Tool Response Conformance" tests with an invalid role error:

Error 400, Message: Please use a valid role: user, model., Status: INVALID_ARGUMENT

This suggests the plugin is sending a role value that the Gemini API doesn't accept (likely tool or function) when constructing tool response messages.

Expected behavior

Tool response messages should use the role expected by the Gemini API (typically user or function). The Go plugin should map the Genkit tool role to whatever the API expects.

Reproduction

cd py && bin/conform check-model google-genai --runtime go --runner native

Look for "Tool Response Conformance" failure on googleai/gemini-3-pro-preview.

Affected models

  • googleai/gemini-3-pro-preview

Notes

This may affect other Gemini models that support tool use. The Python Google GenAI plugin handles role mapping correctly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggo

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions