fix(antigravity): preserve local schema refs - #488
Conversation
|
hi,Preserving structured output contracts in CCA tool declarations is a valuable fix. Sharing two observations regarding traversal overhead and node/byte accounting in 1. Repeated subtree serialization in
|
|
已推送修复提交 |
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed at exact head 9322d4f.
Standards
[P1] The 256 KiB bound is checked only after the full expanded graph has been materialized and JSON-stringified. Many references to one large subtree can amplify a small input dramatically before rejection, allowing excessive allocation or OOM during request preparation. Account for emitted expansion bytes before cloning/materialization.
[P2] The resolver applies depth 16 / node 512 limits to every schema, including schemas with no $ref, while the canonical structured-output boundary accepts depth 24 / 10,000 nodes. This regresses previously valid Antigravity tools. Fast-path no-ref schemas or align the limits with the authoritative boundary.
Spec
[P1] $ref siblings shallow-overwrite referenced keywords. A target containing properties / required combined with sibling constraints loses the referenced constraints instead of preserving conjunction.
[P1] A valid boolean-schema target false is object-spread into {}, reversing “reject everything” into unconstrained acceptance.
[P2] JSON Pointer traversal uses inherited property lookup, so #/$defs/toString can resolve Object.prototype.toString instead of failing closed. Use own-property traversal only.
Please add regressions for sibling collisions, boolean targets, inherited/unresolved pointers, and ordinary no-ref compatibility before merge.
Problem
Closes #465. Antigravity removed
$defsduring tool conversion and$refduring provider sanitization, leaving referenced result-contract properties as{}in the outbound schema.Value
Direct Subagent and Workflow structured-output contracts remain visible to the model while unsupported Cloud Code Assist keywords are still removed.
Approach
Validation
node --test --experimental-strip-types tests/extensions/ai-providers/antigravity.test.tspassed: 39/39.bun run checkpassed: config contract, discipline ledger, Web build/typecheck, format, lint, and TypeScript typecheck.Impact