field note 005 · 2026-10-07 · agents, debugging
multi-city flights cost 10× more, if you ask for business class
in april we added multi-city search to our assistant's flight tools and pulled it out about five hours later, because google seemed to price a linked ticket at ~10× the separate legs. in october we found the problem was our own url.
the setup
bravo, our in-house assistant, searches google flights by building the results url itself. that page takes a tfs parameter, which is url-safe base64 wrapped around a protobuf (google's binary message format) describing the trip: legs, passengers, cabin, and trip type. there's no public schema, so we hand-rolled a small encoder from a reverse-engineered one. the comment above it called the layout "stable for years across multiple open-source projects", and it put cabin in field 1 and trip type in field 9.
the first live runs looked fine. a domestic one-way came back with 10 flights and real layover airports. a multi-city search through two european cities came back with 10 itineraries too, the cheapest at $8,322. so we checked that against the same legs priced on their own.
the april call
by that evening we had the comparison. the linked ticket was $15,483 and the pair of one-ways was $1,654, about 9.4×. the commit that followed is titled "google flights bundles open-jaw fares at ~10x true cost" and calls it "how airlines price linked multi-city tickets".
so we deleted it: the search function, its data model, the tool the agent called, and the test path, 208 lines in all. the test script kept a note telling anyone who came later to search each leg as a separate one-way instead.
what was really going on
in october we built group search (several people from different cities meeting in one place), which leans hard on multi-city and open-jaw searches. wiring it up, we found the real layout: cabin is field 9, and trip type is field 19. our encoder had been writing the trip type into the cabin field since day one.
google reads field 9 as 1 = economy, 2 = premium economy, 3 = business, and 4 = first. our trip type codes were 1 = round trip, 2 = one-way, and 3 = multi-city. so a round trip sent a 1 and came back economy, by luck. a one-way sent a 2 and quietly asked for premium economy. a multi-city sent a 3 and asked for business.