Client or integration
Claude Code
Provider or upstream service
Google Antigravity / Cloud Code Assist
OpenCodex version
2.35.0
Endpoint or capability
/v1/messages; Claude Code Task subagents
Current behaviour
A Claude Code Task subagent routed to google-antigravity/gemini-3.7-flash fails with HTTP 429:
Resource has been exhausted (e.g. check quota).
Controlled comparisons indicate that this is not ordinary quota exhaustion:
- Main Claude Code requests using the same OpenCodex model succeed.
- Equivalent non-Task requests succeed.
- Removing one exact paragraph from the Task subagent system instruction changes the response from 429 to 200.
- Changing tool count, output-token limit, thinking configuration, session identity, or concurrency does not resolve the failure.
The triggering paragraph is:
You are a Claude agent, built on Anthropic's Claude Agent SDK.
A minimal Cloud Code Assist request containing that sentence reproduces the 429. Removing or generically rewriting it returns 200.
Google returns only:
{
"error": {
"code": 429,
"message": "Resource has been exhausted (e.g. check quota).",
"status": "RESOURCE_EXHAUSTED"
}
}
OpenCodex therefore reports the failure as a rate limit even though it is prompt-content-specific.
Expected behaviour
Claude Code should be able to run a Task subagent through Antigravity Gemini 3.7 Flash when the upstream model is otherwise available.
For this compatibility case, OpenCodex should remove the exact rejected identity paragraph while preserving every other system instruction.
Unrelated Google 429 responses should retain their existing quota and rate-limit handling.
Minimal redacted request or reproduction
# Configure a Claude Code subagent to use:
# google-antigravity/gemini-3.7-flash
# Start Claude Code through OpenCodex and request delegation:
Use the Gemini 3.7 Flash subagent and have it reply exactly:
SUBAGENT_OK
# Observed:
# The Task subagent fails with HTTP 429.
#
# Control:
# A main Claude Code request through the same model succeeds.
Distinguishing redacted request fragment:
{
"model": "gemini-3.7-flash-tiered",
"request": {
"systemInstruction": {
"parts": [
{
"text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."
}
]
},
"contents": [
{
"role": "user",
"parts": [{ "text": "Reply OK." }]
}
]
}
}
Controlled results:
Task system instruction containing the exact identity paragraph 429
No system instruction 200
No tools 429
Exact identity paragraph alone 429
Generic agent identity instead 200
Exact identity paragraph removed 200
Actual response or error
HTTP 429
{
"error": {
"code": 429,
"message": "Resource has been exhausted (e.g. check quota).",
"status": "RESOURCE_EXHAUSTED"
}
}
Upstream documentation
No public specification was found for this internal Cloud Code Assist behaviour.
The expected behaviour is based on Claude Code's concrete Task-subagent request shape and controlled requests against the upstream service.
Suggested mapping or implementation notes
Apply the compatibility rewrite after the Gemini systemInstruction is constructed and before the Cloud Code Assist request is serialized:
- Apply only in Cloud Code Assist mode.
- Apply only to
gemini-3.7-flash.
- Remove only a paragraph exactly equal to:
You are a Claude agent, built on Anthropic's Claude Agent SDK.
- Preserve all other system-instruction text and parts.
- Leave other Google transports and model IDs unchanged.
- Do not broadly reclassify Google 429 responses.
A candidate implementation was tested through an isolated OpenCodex instance using the real Claude Code Task flow. Before the rewrite, the subagent returned 429. After the rewrite, one real Task subagent completed and returned:
The focused regression test, typecheck, full test suite, privacy scan, and diff validation passed.
The same patch was then applied to a normal running OpenCodex proxy and verified manually through the Claude Code CLI. A Gemini 3.7 Flash Task subagent completed 10 consecutive tool calls successfully:
Task subagent completed
Tool calls: 10/10 successful
Duration: approximately 43.3 seconds
This human verification exercised the normal Claude Code CLI → OpenCodex /v1/messages → Antigravity Gemini 3.7 Flash path rather than a synthetic adapter-only request.
Additional context and attachments
The full Task request continued to succeed after removing only the exact identity paragraph. Its tools, reasoning configuration, output limit, and remaining system instructions were unchanged.
Related but distinct issues:
No request bodies containing conversation history, credentials, account identifiers, local paths, session identifiers, timestamps, or user-specific configuration are attached.
Checks
Client or integration
Claude Code
Provider or upstream service
Google Antigravity / Cloud Code Assist
OpenCodex version
2.35.0
Endpoint or capability
/v1/messages; Claude Code Task subagentsCurrent behaviour
A Claude Code Task subagent routed to
google-antigravity/gemini-3.7-flashfails with HTTP 429:Controlled comparisons indicate that this is not ordinary quota exhaustion:
The triggering paragraph is:
A minimal Cloud Code Assist request containing that sentence reproduces the 429. Removing or generically rewriting it returns 200.
Google returns only:
{ "error": { "code": 429, "message": "Resource has been exhausted (e.g. check quota).", "status": "RESOURCE_EXHAUSTED" } }OpenCodex therefore reports the failure as a rate limit even though it is prompt-content-specific.
Expected behaviour
Claude Code should be able to run a Task subagent through Antigravity Gemini 3.7 Flash when the upstream model is otherwise available.
For this compatibility case, OpenCodex should remove the exact rejected identity paragraph while preserving every other system instruction.
Unrelated Google 429 responses should retain their existing quota and rate-limit handling.
Minimal redacted request or reproduction
Distinguishing redacted request fragment:
{ "model": "gemini-3.7-flash-tiered", "request": { "systemInstruction": { "parts": [ { "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK." } ] }, "contents": [ { "role": "user", "parts": [{ "text": "Reply OK." }] } ] } }Controlled results:
Actual response or error
HTTP 429 { "error": { "code": 429, "message": "Resource has been exhausted (e.g. check quota).", "status": "RESOURCE_EXHAUSTED" } }Upstream documentation
No public specification was found for this internal Cloud Code Assist behaviour.
The expected behaviour is based on Claude Code's concrete Task-subagent request shape and controlled requests against the upstream service.
Suggested mapping or implementation notes
Apply the compatibility rewrite after the Gemini
systemInstructionis constructed and before the Cloud Code Assist request is serialized:gemini-3.7-flash.A candidate implementation was tested through an isolated OpenCodex instance using the real Claude Code Task flow. Before the rewrite, the subagent returned 429. After the rewrite, one real Task subagent completed and returned:
The focused regression test, typecheck, full test suite, privacy scan, and diff validation passed.
The same patch was then applied to a normal running OpenCodex proxy and verified manually through the Claude Code CLI. A Gemini 3.7 Flash Task subagent completed 10 consecutive tool calls successfully:
This human verification exercised the normal Claude Code CLI → OpenCodex
/v1/messages→ Antigravity Gemini 3.7 Flash path rather than a synthetic adapter-only request.Additional context and attachments
The full Task request continued to succeed after removing only the exact identity paragraph. Its tools, reasoning configuration, output limit, and remaining system instructions were unchanged.
Related but distinct issues:
No request bodies containing conversation history, credentials, account identifiers, local paths, session identifiers, timestamps, or user-specific configuration are attached.
Checks