History

**refactor(antigravity): handle `anyOf` property, remove `exclusiveMinimum`, and comment unused prod URL**

Luis Pater committed 11 months ago

Commit d4d52981 parent 361443d1 file · +14 −1Browse files

Unified · Split

internal/runtime/executor/antigravity_executor.go+14−1
@@ -525,6 +525,19 @@ func (e *AntigravityExecutor) buildRequest(ctx context.Context, auth *cliproxyau · 524 unmodified lines
525525 strJSON = util.DeleteKey(strJSON, "minItems")
526526 strJSON = util.DeleteKey(strJSON, "minLength")
527527 strJSON = util.DeleteKey(strJSON, "maxLength")
528+ strJSON = util.DeleteKey(strJSON, "exclusiveMinimum")
529+
530+ paths = make([]string, 0)
531+ util.Walk(gjson.Parse(strJSON), "", "anyOf", &paths)
532+ for _, p := range paths {
533+ anyOf := gjson.Get(strJSON, p)
534+ if anyOf.IsArray() {
535+ anyOfItems := anyOf.Array()
536+ if len(anyOfItems) > 0 {
537+ strJSON, _ = sjson.SetRaw(strJSON, p[:len(p)-len(".anyOf")], anyOfItems[0].Raw)
538+ }
539+ }
540+ }
528541
529542 payload = []byte(strJSON)
530543 }
@@ -665,7 +678,7 @@ func antigravityBaseURLFallbackOrder(auth *cliproxyauth.Auth) []string { · 134 unmodified lines
665678 return []string{
666679 antigravityBaseURLDaily,
667680 antigravityBaseURLAutopush,
668− antigravityBaseURLProd,
681+ // antigravityBaseURLProd,
669682 }
670683 }
671684