Description
When using clients like Amp that proxy requests through CLIProxyAPI to Google's Gemini API via the antigravity translator, requests fail with a 400 error:
* GenerateContentRequest.contents[2].parts[0].function_response.name: Name cannot be empty.
* GenerateContentRequest.contents[2].parts[1].function_response.name: Name cannot be empty.
...
Steps to Reproduce
- Use Amp (or any client) connected to CLIProxyAPI's antigravity endpoint
- Trigger a multi-tool-call interaction (e.g. the finder/search agent)
- The model returns multiple
functionCall parts, client executes them and sends back functionResponse parts
- The proxy forwards
functionResponse parts with empty name fields to Gemini API
- Gemini rejects the request with 400 INVALID_ARGUMENT
Root Cause
Incoming requests from clients include functionResponse parts without populating the name field. The proxy's fixCLIToolResponse in the antigravity translator forwards them as-is without resolving the name from the corresponding functionCall parts in the preceding model content.
Additionally, ConvertOpenAIResponsesRequestToGemini scans the raw input array for matching function_call items by call_id, but may fail to find matches since the function calls may not be present as top-level items in the input.
Expected Behavior
The proxy should backfill empty functionResponse.name from the corresponding functionCall.name before forwarding to Gemini.
Environment
- CLIProxyAPI antigravity translator
- Google Gemini API (daily-cloudcode-pa.googleapis.com)
- Client: Amp (finder/search subagent)
Description
When using clients like Amp that proxy requests through CLIProxyAPI to Google's Gemini API via the antigravity translator, requests fail with a 400 error:
Steps to Reproduce
functionCallparts, client executes them and sends backfunctionResponsepartsfunctionResponseparts with emptynamefields to Gemini APIRoot Cause
Incoming requests from clients include
functionResponseparts without populating thenamefield. The proxy'sfixCLIToolResponsein the antigravity translator forwards them as-is without resolving the name from the correspondingfunctionCallparts in the preceding model content.Additionally,
ConvertOpenAIResponsesRequestToGeminiscans the raw input array for matchingfunction_callitems bycall_id, but may fail to find matches since the function calls may not be present as top-level items in the input.Expected Behavior
The proxy should backfill empty
functionResponse.namefrom the correspondingfunctionCall.namebefore forwarding to Gemini.Environment