Repository navigation
Gemini side task fails with 400 due to unsupported encrypted field #85
Description
Summary
When I select a Gemini model for a side task in Codex through OpenCodex, the request fails with HTTP 400 before streaming begins.
The Google Antigravity API rejects the generated tool schema because it contains an unsupported field named encrypted.
Steps to reproduce
- Enable and configure OpenCodex in Codex.
- Configure the
google-antigravityprovider. - Start a side task.
- Select
google-antigravity/gemini-3.5-flash-high. - Set the reasoning effort to
max. - Send a prompt in a context where Codex tools are available.
Expected behavior
The side task should start successfully using the selected Gemini model.
The available Codex tools should be converted into a schema supported by the Google Antigravity API.
Actual behavior
The request fails immediately with HTTP 400 and invalid_request_error.
The upstream response reports that an encrypted field was included in multiple function declarations, but this field is not recognized by the Antigravity API schema.
Error log
{
"requestId": "ocx-mreja3p0-1p",
"timestamp": 1783663643700,
"model": "gemini-3.5-flash-high",
"provider": "google-antigravity",
"requestedModel": "google-antigravity/gemini-3.5-flash-high",
"requestedEffort": "max",
"status": 400,
"durationMs": 507,
"errorCode": "invalid_request_error",
"closeReason": "non_stream",
"upstreamError": "Provider error 400: Antigravity invalid request: Invalid JSON payload received. Unknown name \"encrypted\" at 'request.tools[0].function_declarations[9].parameters.properties[0].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"encrypted\" at 'request.tools[0].function_declarations[12].parameters.properties[0].value': Cannot find field.",
"usageStatus": "unreported"
}Suspected cause
OpenCodex appears to be forwarding or generating the non-standard encrypted property inside one or more tool parameter schemas.
The Google Antigravity API does not accept this property in its function_declarations schema. Unsupported schema fields may need to be removed before sending requests to Gemini through Antigravity.
The error references at least the following declarations:
request.tools[0].function_declarations[9]request.tools[0].function_declarations[12]
Environment
- OpenCodex version or commit:
2.7.3 - Codex app version:
latest - OS:
Windows 11 25H2 - Provider:
google-antigravity - Model:
gemini-3.5-flash-high - Requested reasoning effort:
max
Provider configuration verification
I verified that the built-in google-antigravity provider is being used with the following configuration:
- Adapter:
google - Authentication:
oauth - Google mode:
cloud-code-assist - Base URL:
https://daily-cloudcode-pa.googleapis.com - Default model:
gemini-3.5-flash-low - Selected side-task model:
gemini-3.5-flash-high
The Google account is authenticated successfully, quota information is available, and gemini-3.5-flash-high is present in the provider's model list.
Therefore, this does not appear to be caused by a custom provider or an incorrectly registered model.
Activity
lidge-jun commentedon Jul 10, 2026
Thanks for the report. We've confirmed this is a compatibility issue with the multi-agent v2 tool schema: Gemini rejects the Responses-only
encryptedfield.Until a fix is released, please switch back to multi-agent v1 as a temporary workaround. We'll update this issue once the fix is available.
Jossi02 commentedon Jul 10, 2026
I switched the multi-agent mode to v1, restarted the Codex app, and created a completely new chat.
Gemini side tasks now work correctly in the new v1 chat. Existing chats created under v2 continued to fail with the same
encryptedfield error, as expected.This confirms that the issue is specific to the multi-agent v2 tool schema. Thanks for the workaround.
lidge-jun commentedon Jul 10, 2026
Fixed in commit e335e84 on
dev.Root cause: upstream openai/codex (commit
5f4d06ef, PR #26210) stamps a Responses-only JSON-Schema markerencrypted: trueon the v2 collaboration tool schemas (spawn_agent/send_message/followup_task→messageproperty). Since v2.7.3 opencodex forwards Codex Desktop's v2additional_tools, and the Gemini sanitizer's keyword blacklist didn't coverencrypted, so the marker reached the Google backend verbatim — Gemini/Antigravity rejects the whole request with400 Invalid JSON payload... Unknown name "encrypted"before streaming, even if the tool is never called.Fix:
google-tool-schema.ts:encryptedadded toDROPPED_SCHEMA_KEYS— stripped recursively from every functionDeclaration.kiro-tools.ts: same defensive strip for the Kiro/Bedrock wire (its validator also rejects an undocumented narrow schema subset).functionDeclarations), and kiro wire levels. OpenAI Responses passthrough keeps the marker untouched, as required.We also ran a provider risk audit for this keyword class: OpenAI chat non-strict is contractually tolerant (
additionalProperties: true), Anthropic/Cursor are unverified but now defensively covered where evidence warranted, Bedrock-family is the riskiest and is covered.Workaround until the next release: keep multi-agent on v1, or use
reasoninglevels that don't expose the v2 collaboration tools. The fix will ship in the next release. Thanks for the clean report and for confirming the v1 workaround!lidge-jun commentedon Jul 10, 2026
Closing — fixed by e335e84 (ships in the next release).
fix(google,kiro): strip Codex's Responses-only encrypted marker from …
fix(anthropic): strip Codex's Responses-only encrypted marker from to…
Merge origin/dev (PR #87 images endpoint) with encrypted-marker fixes (…
fix(google,kiro): strip Codex's Responses-only encrypted marker from …
fix(anthropic): strip Codex's Responses-only encrypted marker from to…
Merge origin/dev (PR lidge-jun#87 images endpoint) with encrypted-mar…