fix: log gemini cli schema cleanup errors

This commit is contained in:
sususu98
2026-05-26 10:52:53 +08:00
parent 70a8cf026f
commit 4a85b6b97e

View File

@@ -889,7 +889,12 @@ func cleanGeminiCLIRequestSchemas(body []byte) []byte {
}
cleaned := util.CleanJSONSchemaForGemini(params.Raw)
path := fmt.Sprintf("request.tools.%d.%s.%d.%s", i, declarationsKey, j, schemaKey)
body, _ = sjson.SetRawBytes(body, path, []byte(cleaned))
updated, errSet := sjson.SetRawBytes(body, path, []byte(cleaned))
if errSet != nil {
log.Errorf("gemini cli executor: failed to set cleaned schema at %s: %v", path, errSet)
continue
}
body = updated
}
}
}
@@ -905,7 +910,12 @@ func cleanGeminiCLIRequestSchemas(body []byte) []byte {
continue
}
cleaned := util.CleanJSONSchemaForGemini(responseSchema.Raw)
body, _ = sjson.SetRawBytes(body, schemaPath, []byte(cleaned))
updated, errSet := sjson.SetRawBytes(body, schemaPath, []byte(cleaned))
if errSet != nil {
log.Errorf("gemini cli executor: failed to set cleaned response schema at %s: %v", schemaPath, errSet)
continue
}
body = updated
}
return body