Client or integration
OpenAI-compatible Chat Completions / Multi-modal API (/v1/chat/completions)
Area
Tools / MCP / Provider compatibility
Summary
When sending a video payload (video_url with data URI or URL) to google-antigravity/gemini-3.7-flash (or Gemini 2.5/3.1 multimodal endpoints), the upstream Vertex / Antigravity provider internally emits built-in server-side helper function calls (such as get_video_duration, get_video_info, or video_analysis:get_video_info) to inspect video metadata before finishing the turn.
Because these tools are internally generated by Google's multimodal runtime and were not explicitly provided in the client's tools array, OpenCodeX's undeclared tool security guard (declaredToolNames check in src/bridge.ts line 1041-1045 and src/server/responses-undeclared-tool-guard.ts) immediately intercepts and aborts the response with HTTP 502:
502 Bad Gateway
{"error":{"message":"routed provider emitted undeclared client tool \"get_video_duration\"; only request-declared tools may be called","type":"server_error","param":null,"code":"upstream_server_error"}}
Expected: Either internal provider-native multimodal inspection tools (e.g. get_video_duration, get_video_info, video_analysis:*) are recognized as provider-internal and allowed/executed transparently, or bypassed in the client tool name declaration guard.
Reproduction
- Route a chat completion request to
google-antigravity/gemini-3.7-flash with a video attachment via /v1/chat/completions:
{
"model": "google-antigravity/gemini-3.7-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Summarize this video" },
{ "type": "video_url", "video_url": { "url": "data:video/mp4;base64,..." } }
]
}
]
}
- Observe HTTP 502 response returned from OpenCodeX proxy:
{
"error": {
"message": "routed provider emitted undeclared client tool \"get_video_duration\"; only request-declared tools may be called",
"code": "upstream_server_error"
}
}
Version
@bitkyc08/opencodex@2.31.0 (also verified in 2.26.0)
Operating system
Windows 11 / Linux (x86_64)
Provider and model
google-antigravity/gemini-3.7-flash
Logs or error output
HTTP/1.1 502 Bad Gateway
Content-Type: application/json
{
"error": {
"message": "routed provider emitted undeclared client tool \"get_video_duration\"; only request-declared tools may be called",
"type": "server_error",
"param": null,
"code": "upstream_server_error"
}
}
Upstream error from Vertex AI / Antigravity streaming bridge:
Vertex AI response truncated upstream before the turn completed (MALFORMED_FUNCTION_CALL / undeclared tool get_video_duration)
Checks
Client or integration
OpenAI-compatible Chat Completions / Multi-modal API (
/v1/chat/completions)Area
Tools / MCP / Provider compatibility
Summary
When sending a video payload (
video_urlwith data URI or URL) togoogle-antigravity/gemini-3.7-flash(or Gemini 2.5/3.1 multimodal endpoints), the upstream Vertex / Antigravity provider internally emits built-in server-side helper function calls (such asget_video_duration,get_video_info, orvideo_analysis:get_video_info) to inspect video metadata before finishing the turn.Because these tools are internally generated by Google's multimodal runtime and were not explicitly provided in the client's
toolsarray, OpenCodeX's undeclared tool security guard (declaredToolNamescheck insrc/bridge.tsline 1041-1045 andsrc/server/responses-undeclared-tool-guard.ts) immediately intercepts and aborts the response with HTTP 502:Expected: Either internal provider-native multimodal inspection tools (e.g.
get_video_duration,get_video_info,video_analysis:*) are recognized as provider-internal and allowed/executed transparently, or bypassed in the client tool name declaration guard.Reproduction
google-antigravity/gemini-3.7-flashwith a video attachment via/v1/chat/completions:{ "model": "google-antigravity/gemini-3.7-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Summarize this video" }, { "type": "video_url", "video_url": { "url": "data:video/mp4;base64,..." } } ] } ] }{ "error": { "message": "routed provider emitted undeclared client tool \"get_video_duration\"; only request-declared tools may be called", "code": "upstream_server_error" } }Version
@bitkyc08/opencodex@2.31.0(also verified in 2.26.0)Operating system
Windows 11 / Linux (x86_64)
Provider and model
google-antigravity/gemini-3.7-flashLogs or error output
Upstream error from Vertex AI / Antigravity streaming bridge:
Vertex AI response truncated upstream before the turn completed (MALFORMED_FUNCTION_CALL / undeclared tool get_video_duration)Checks