When a request's messages array ends with a role: "system" message (Claude Code sends these), the proxy converts it to an assistant turn and the request fails:
400 invalid_message_role: The last message in a Gemini request must not be from the assistant
Repro:
{"model":"gemini-3.6-flash","messages":[{"role":"user","content":"hi"},{"role":"system","content":"do x"}]}
translateAnthropicMessagesToOpenAI only handles role: "user" and treats everything else as assistant. Suggest folding role:"system" text into the system prompt instead.
When a request's
messagesarray ends with arole: "system"message (Claude Code sends these), the proxy converts it to an assistant turn and the request fails:Repro:
{"model":"gemini-3.6-flash","messages":[{"role":"user","content":"hi"},{"role":"system","content":"do x"}]}translateAnthropicMessagesToOpenAIonly handlesrole: "user"and treats everything else as assistant. Suggest foldingrole:"system"text into the system prompt instead.