Every deep-link from build_flight_booking_url opens in economy for 1 passenger, regardless of the cabin searched, because the tfs seat-class field is hardcoded to 1 in build_tfs_token with no parameter. Affects the flights command's links too, not just multi. Verified by hand: flipping the field to 3 yields a business-class booking page. (Passenger count has the same issue but its encoding is a nested message — scoping this to cabin and noting pax as a follow-up.)
--- a/src/fli/search/_proto.py
+++ b/src/fli/search/_proto.py
@@ def build_tfs_token(
-def build_tfs_token(segments, *, is_one_way: bool = True) -> str:
+def build_tfs_token(segments, *, is_one_way: bool = True, seat: int = 1) -> str:
@@ payload = (
- + _varint_field(9, 1)
+ + _varint_field(9, seat) # 1=economy 2=premium 3=business 4=first
--- a/src/fli/search/flights.py
+++ b/src/fli/search/flights.py
@@ def build_flight_booking_url(self, flight, *, currency=None, language=None, country=None):
+ # seat_type: SeatType (ECONOMY=1 … FIRST=4); default economy for back-compat
- tfs = build_tfs_token(segments, is_one_way=is_one_way)
+ tfs = build_tfs_token(segments, is_one_way=is_one_way, seat=seat_type.value)
Plus: add seat_type: SeatType = SeatType.ECONOMY to build_flight_booking_url's signature, and have the callers (cli/commands/flights.py, mcp/server.py::_execute_search) pass the search's seat_type through.
Every deep-link from
build_flight_booking_urlopens in economy for 1 passenger, regardless of the cabin searched, because thetfsseat-class field is hardcoded to1inbuild_tfs_tokenwith no parameter. Affects theflightscommand's links too, not justmulti. Verified by hand: flipping the field to3yields a business-class booking page. (Passenger count has the same issue but its encoding is a nested message — scoping this to cabin and noting pax as a follow-up.)Plus: add
seat_type: SeatType = SeatType.ECONOMYtobuild_flight_booking_url's signature, and have the callers (cli/commands/flights.py,mcp/server.py::_execute_search) pass the search'sseat_typethrough.