Skip to content

fix: align responses tool conversion with Vertex schema#3524

Open
bhrum wants to merge 1 commit into
router-for-me:devfrom
bhrum:fix-vertex-responses-tools
Open

fix: align responses tool conversion with Vertex schema#3524
bhrum wants to merge 1 commit into
router-for-me:devfrom
bhrum:fix-vertex-responses-tools

Conversation

@bhrum
Copy link
Copy Markdown

@bhrum bhrum commented May 23, 2026

Summary

  • Treat OpenAI Responses developer messages as Gemini system instructions when converting to Gemini requests.
  • Stop forwarding OpenAI Responses call_id values as functionCall.id / functionResponse.id, which Vertex Gemini rejects as unknown fields.
  • Add request-conversion tests covering both cases.

Why

When Codex uses the OpenAI Responses API through CLIProxyAPI against Vertex Gemini, tool-call history can fail with errors like:

Unknown name "id" at 'contents[].parts[].function_call': Cannot find field.
Unknown name "id" at 'contents[].parts[].function_response': Cannot find field.

Codex can also send developer role messages, while Gemini request contents only accept Gemini roles such as user and model; system/developer instructions should be represented via systemInstruction.

Test plan

  • go test ./internal/translator/gemini/openai/responses ./sdk/api/handlers/openai

@github-actions github-actions Bot changed the base branch from main to dev May 23, 2026 21:22
@github-actions
Copy link
Copy Markdown

This pull request targeted main.

The base branch has been automatically changed to dev.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OpenAI to Gemini response request translator to support the 'developer' role by mapping it to Gemini's system instructions. It also removes the forwarding of function call and response IDs to the Gemini API. Corresponding unit tests have been added to ensure the 'developer' role is correctly handled and that function IDs are no longer included in the output. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant