This partially randomized phase I/II trial studies the side effects and best dose of c-Met inhibitor AMG 337 when given together with oxaliplatin, leucovorin calcium, and fluorouracil and to see how well they work in treating patients with stomach or esophageal cancer that has spread to other places in the body and usually cannot be cured or controlled with treatment. C-Met inhibitor AMG 337 may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. 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 c-Met inhibitor AMG 337 with oxaliplatin, leucovorin calcium, and fluorouracil may kill more tumor cells.