Repository navigation
Closed
Labels
providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools
Description
Client or integration
Codex App
Provider or upstream service
google-vertex (Google Vertex AI — gemini-4-neon, gemini-3.8-flash)
OpenCodex version
2.100.5 (same 3-model allowlist and missing gemini-4-neon registry entry are still present on dev at 6a4ae9d6)
Endpoint or capability
POST /v1/responses translated to Vertex AI :streamGenerateContent / :generateContent with tool-result images (input_image inside custom_tool_call_output / function_call_output), plus google / google-vertex built-in registry metadata for gemini-4-neon
Current behaviour
- When a tool call returns an image (for example
execemitting PNG/WebPinput_imageblocks orview_image), the immediately following Vertex AI request fails with HTTP 400 (Requests ending with a model turn are not supported.) on models outside the hardcoded 3-model allowlist (gemini-4-argon,gemini-4-carbon,gemini-4-hydrogen):google-vertex/gemini-4-neon(2026-11-20,ocx2.100.5,location: "global"): text-only tool turns succeeded in the same thread; the first turn whosecustom_tool_call_outputcontained 3input_imageparts (1 PNG + 2 WebP) failed immediately with HTTP 400. A follow-up user message afterward allowed the thread to continue with the same image tool output in history.google-vertex/gemini-3.8-flash(2026-10-22): identical HTTP 400 on Vertex AI.
gemini-4-neon(GA 2026-11-18) is also absent fromGEMINI_MODEL_REASONING_EFFORTS,GEMINI_MODEL_DEFAULT_REASONING_EFFORTS,modelContextWindows,modelInputModalitiesinsrc/providers/registry/entries-core.ts, andscripts/model-metadata.source.json.
Expected behaviour
- Vertex AI Gemini 3+ models (including
gemini-3.8-flash,gemini-4-neon, and future live-discoveredgemini-4-*models via feat(google-vertex): support live Publisher Models discovery, gemini-4-carbon, and gemini-4-hydrogen #8583) should nest matched tool-result images insidefunctionResponse.partsand separate image-bearing orphan batches, matching ADR-7279. gemini-4-neonshould be registered in the shared Google / Vertex registry tables and generated model metadata with its documented capabilities (low/medium/high[default]/xhigh, 1,048,576 context window, 65,536 max output tokens,["text", "image"]).
Minimal redacted request or reproduction
# Reproduce through OpenCodex with google-vertex/gemini-4-neon (or gemini-3.8-flash):
# 1. Start a Codex App turn using google-vertex/gemini-4-neon.
# 2. Run a tool that returns text + input_image (PNG/WebP data URL) in custom_tool_call_output / function_call_output.
# 3. OpenCodex translates the trailing tool result as:
# {"role":"user","parts":[
# {"functionResponse":{"name":"exec","id":"call_...","response":{"result":"..."}}},
# {"inline_data":{"mime_type":"image/png","data":"<base64>"}}
# ]}
# and Vertex AI returns HTTP 400:
# "Requests ending with a model turn are not supported."
#
# Moving inline_data into functionResponse.parts (ADR-7279 / #7280 / #8583) matches
# Google's documented multimodal function-response format for Gemini 3+.Actual response or error
HTTP 400 Bad Request
{"error":{"message":"Provider error 400: Vertex AI invalid request: Requests ending with a model turn are not supported.","type":"upstream_error","code":null}}
# Observed in usage.jsonl (redacted):
# 1) 2026-10-22 | provider=google-vertex | model=gemini-3.8-flash | status=400 | failureCause=payload-rejected
# upstreamError: "Provider error 400: Vertex AI invalid request: Requests ending with a model turn are not supported."
# 2) 2026-11-20 | provider=google-vertex | model=gemini-4-neon | status=400 | failureCause=payload-rejected
# client=codex_desktop | requestBody.decodedBytes=891109 (3 inline images in trailing custom_tool_call_output)Upstream documentation
- https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/tools/function-calling (multimodal function responses via
functionResponse.partsfor Gemini 3+) - https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking (
gemini-4-neonthinking levelslow/medium/high[default]/xhigh, context/output limits) - Prior contract and amendments: Vertex Argon rejects tool-result images with misleading model-turn 400 #7279, fix(google): preserve matched and orphan Vertex Argon tool images #7280, feat(google-vertex): support live Publisher Models discovery, gemini-4-carbon, and gemini-4-hydrogen #8583,
structure/decisions/ADR-7279-vertex-argon-tool-images.md
Suggested mapping or implementation notes
src/adapters/google.ts: replace the 3-model check onprovider.googleMode === "vertex"with/^gemini-(?:[3-9]|\d{2,})(?:[.-]|$)/i.test(parsed.modelId).src/providers/registry/entries-core.tsandscripts/model-metadata.source.json(plusbun run generate:model-metadata): addgemini-4-neonwith["low", "medium", "high", "xhigh"], default"high", 1,048,576 context, 65,536 max output, and["text", "image"].- Update
structure/decisions/ADR-7279-vertex-argon-tool-images.md,structure/providers/google.md,docs-siteguides, and Vertex adapter/catalog tests.
Additional context and attachments
Related: #7279, #7280, #8583.
Workaround: use google-vertex/gemini-4-hydrogen for image-heavy tool turns.
Environment: macOS arm64, Codex App (codex-cli 0.169.1), OpenCodex 2.100.5.
Checks
- I searched existing provider and compatibility issues.
- The request and response were redacted.
- The expected behaviour is based on an upstream specification or a concrete client requirement.
Reacted by coderabbitai
Metadata
Metadata
Assignees
Labels
providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools
Activity
coderabbitai commentedon Nov 19, 2026
🔗 Related PRs
#8583 - feat(google-vertex): support live Publisher Models discovery, gemini-4-carbon, and gemini-4-hydrogen [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
lidge-jun commentedon Nov 20, 2026
Fixed by #8970, squash-merged into dev as efd711e.