Commit c745d73
committed
refactor(antigravity): 🔨 inline JSON schema references before sanitization
Introduced `_inline_schema_refs()` function to resolve local $ref definitions in JSON schemas before applying Claude-specific sanitization. This ensures that schema references are properly expanded and circular references are handled gracefully.
- Added new helper function to recursively resolve $ref pointers from $defs and definitions
- Circular reference detection prevents infinite loops by tracking seen references
- Applied inlining step before `_clean_claude_schema()` in both tool transformation flows
- Updated docstring to reflect the new two-step sanitization process (inline, then clean)
- Removed extraneous `$schema` pop that was no longer needed
This change improves schema compatibility with Antigravity/Gemini's Proto-based API by ensuring all references are resolved before unsupported JSON Schema keywords are stripped.1 parent e4bf852 commit c745d73
1 file changed
+34
-8
lines changedLines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
343 | 370 | | |
344 | 371 | | |
345 | 372 | | |
| |||
397 | 424 | | |
398 | 425 | | |
399 | 426 | | |
400 | | - | |
401 | 427 | | |
402 | 428 | | |
403 | 429 | | |
| |||
2507 | 2533 | | |
2508 | 2534 | | |
2509 | 2535 | | |
2510 | | - | |
2511 | 2536 | | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
2512 | 2540 | | |
2513 | 2541 | | |
2514 | 2542 | | |
| |||
2667 | 2695 | | |
2668 | 2696 | | |
2669 | 2697 | | |
2670 | | - | |
| 2698 | + | |
2671 | 2699 | | |
2672 | 2700 | | |
2673 | 2701 | | |
2674 | 2702 | | |
2675 | 2703 | | |
2676 | 2704 | | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
2681 | | - | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
2682 | 2708 | | |
2683 | 2709 | | |
2684 | 2710 | | |
| |||
0 commit comments