This randomized phase II trial studies combination chemotherapy when given together with vismodegib to see how well it works compared with combination chemotherapy without vismodegib in treating patients with advanced stomach cancer or gastroesophageal junction cancer. Drugs used in chemotherapy, such as oxaliplatin, leucovorin calcium, and fluorouracil, work in different ways to stop the growth of tumor cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Giving more than one drug (combination chemotherapy) may kill more tumor cells. Vismodegib may stop the growth of stomach or gastroesophageal junction cancer by blocking the growth of new blood vessels necessary for tumor growth. It is not yet known whether combination chemotherapy is more effective when given with or without vismodegib in treating stomach cancer and gastroesophageal junction cancer.