Repository navigation
Conversation
…de Assist TypeBox serializes Type.Union([Type.Literal(...)]) tool parameters as anyOf branches carrying "const". Cloud Code Assist validates function declarations against OpenAPI 3.0, which has no "const", so every request from a session with such a tool 400s with "Unknown name \"const\" at ...parameters.properties[N].value.any_of[M]" (e.g. subagent_check.evidence since openpi-dev#652; setup's role/browser unions are affected too). enum-carrying parameters in the same payload pass, so rewrite const to a single-value enum in sanitizeSchemaForCca instead of dropping the constraint. Verified live: pi -ne -a -e ai-providers -e subagents against google-antigravity/gemini-3.8-flash-high 400s before, replies after the rewrite; broader load with workflows+setup passes as well. Unit tests cover anyOf-branch literals, enum merging, and a property named const.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since #652 (first released in v0.10.0), every Antigravity request fails with a 400 as soon as a session loads a tool whose TypeBox schema contains a literal union —
subagent_check'sevidenceparameter being the in-tree instance (Type.Union([Type.Literal("transcript"), ...]), serialized asanyOfbranches carrying"const"). Cloud Code Assist validates function declarations against OpenAPI 3.0, which has noconst, and protojson rejects the whole request:This affects every
google-antigravityuser on v0.10.0–v1.1.0 with the subagents extension loaded (i.e. the default surface). Setup's role/browser literal unions trigger the same 400 when that extension's tools are registered. No issue exists for it yet; the verbatim error above is included so it is searchable.Value
Restores Antigravity usability for all affected users; the fix is contained in the provider's existing schema sanitizer rather than requiring schema changes in every extension that uses literal unions.
Approach
sanitizeSchemaForCcaalready strips OpenAPI-rejected keywords on the wire path shared by the Gemini and Claude routes (buildTools); this adds a rewrite ofconst: Xinto a single-valueenum: [X], merging with any siblingenumwithout duplicates.enumis proven accepted: enum-carrying parameters (subagent_spawn.agent_type,intercom.action) pass in the exact payloads that 400 onconst. The advertised value set is unchanged, so the model-visible semantics are identical.Relates to #465 (same sanitizer, adjacent failure class — does not address the
$refdrop described there).Validation
node --test --experimental-strip-types tests/extensions/ai-providers/antigravity.test.ts: all pass, including new cases for anyOf-branch literals, enum merging, and a property namedconst.google-antigravity/gemini-3.8-flash-highwithpi -ne -a -e ./extensions/ai-providers/index.ts -e ./extensions/subagents/index.ts -p "Reply with exactly: OK": before (main@ea4dfb99) reproduces the verbatim 400; after, the model replies OK.bun run check: clean (biome format/lint, tsc --noEmit).node scripts/run-tests.mjs): 2 failures intests/extensions/code-mode/index.test.tsthat fail identically on clean main (pre-existing, unrelated).Impact
Model-visible context/tools:
subagent_check.evidenceis now advertised asanyOfof singletonenumbranches instead ofconstliterals — the same value set. No user-visible, config, persistence, or lifecycle change. Out-of-tree tools carryingconstschemas stop 400ing the session.