fix: add CLI passenger option and click dependency - #210
Open
hishamank wants to merge 1 commit into
Open
Conversation
felciano
added a commit
to felciano/fli
that referenced
this pull request
Aug 31, 2026
felciano
added a commit
to felciano/fli
that referenced
this pull request
Aug 31, 2026
The success path echoes "passengers" in the JSON query block, but the two inline query dicts in the ParseError and AttributeError/ValueError handlers omitted it, so a consumer reading query.passengers hit a KeyError on parse failures. Flagged in review on upstream PR punitarani#210 but left unfixed there.
felciano
added a commit
to felciano/fli
that referenced
this pull request
Aug 31, 2026
…alls fli/cli imports rich (console.py, utils.py, commands/airports.py) and fli/mcp/server.py imports mcp.types.Icon, but neither package was declared in pyproject.toml. Both arrived only transitively -- rich via typer, mcp via fastmcp. This is the same bug class that broke click: typer dropped its click dependency after 0.16, and every fresh pipx install died with ModuleNotFoundError. typer 0.27.2 no longer declares click at all, leaving rich as the last load-bearing transitive edge. Declare "rich>=13.8.0" in [project].dependencies and "mcp>=1.15.0" in the mcp extra, then regenerate uv.lock with the resolver (5 added lines, no version churn). The rich floor (13.8.0) is deliberately higher than typer 0.16's declared rich>=10.11.0, pinning the version fli/cli actually relies on rather than whatever floor typer happens to carry. The mcp floor is the true API floor, verified by install: Icon is absent from mcp.types in 1.14.0 and present in 1.15.0 -- upstream's proposed >=1.2.0 would have declared a floor the code cannot run on. Adds tests/test_dependency_declarations.py, which AST-walks every module under fli/ and diffs the third-party imports against the declared requirements, so the bug class fails CI rather than a user's install. Takes only the undeclared-dependency half of upstream PR punitarani#222. Its fli/cli/utils.py hunk (click.Context/Parameter -> typer.Context/ typer.CallbackParam) is deliberately not applied, as it would revert the verified click handling from PR punitarani#210. Co-authored-by: Carter Temm <cartertemm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clickruntime dependency used byfli.cli.utils--passengers/-ptoflights,dates, andmultiCLI commandsPassengerInfoinstead of hardcodingadults=1Verification
uv run ruff check fli/cli/commands/flights.py fli/cli/commands/dates.py fli/cli/commands/multi.py tests/cli/test_flights.py tests/cli/test_dates.py tests/cli/test_multi.pyuv run pytest tests/cli/test_flights.py tests/cli/test_dates.py tests/cli/test_multi.py -q→ 50 passeduv run pytest tests/cli tests/models/test_flight_search_filters.py tests/models/test_date_search_filters.py -q→ 149 passedNote: I also started the full
uv run pytest -qsuite, but it produced no output after ~3 minutes and appeared to be blocked on broader/live tests, so I stopped it and ran the relevant non-live suites above.Greptile Summary
This PR fixes a missing
clickruntime dependency and adds a--passengers/-poption to theflights,dates, andmultiCLI commands, replacing a hardcodedadults=1inPassengerInfowith the user-supplied value.click>=8.0.0is added topyproject.tomlbecausefli/cli/utils.pydirectly importsContextandParameterfrom it; previously the import worked only becausetyperpullsclickin transitively.--passengers/-p(default1, min1); the value flows intoPassengerInfo(adults=passengers)and is echoed in the JSONqueryblock forflightsanddates.test_flights.py,test_dates.py, andtest_multi.pyverify both the filter value and (for JSON-capable commands) the query echo.Confidence Score: 4/5
The change is straightforward and well-tested; the only rough edge is that the dates command error-path query dicts omit the new field.
The core logic — wiring the CLI flag through to PassengerInfo — is correct across all three commands and is covered by new unit tests. The one gap is that the two inline error-path query dicts in dates.py do not include
passengers, so a JSON consumer checkingquery.passengerson a parse or validation failure would find the key absent, inconsistent with the success response.fli/cli/commands/dates.py — the ParseError and AttributeError/ValueError handler inline query dicts should include
passengersto match the success-path shape.Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant CLI as CLI Command(flights/dates/multi) participant Core as PassengerInfo participant Search as SearchFlights/SearchDates User->>CLI: fli flights JFK LHR 2026-10-25 --passengers 2 CLI->>CLI: "Validate passengers (min=1)" CLI->>Core: "PassengerInfo(adults=passengers)" CLI->>Search: "search(FlightSearchFilters(passenger_info=...))" Search-->>CLI: results CLI-->>User: "Flight results (text or JSON with query.passengers=2)"%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant CLI as CLI Command(flights/dates/multi) participant Core as PassengerInfo participant Search as SearchFlights/SearchDates User->>CLI: fli flights JFK LHR 2026-10-25 --passengers 2 CLI->>CLI: "Validate passengers (min=1)" CLI->>Core: "PassengerInfo(adults=passengers)" CLI->>Search: "search(FlightSearchFilters(passenger_info=...))" Search-->>CLI: results CLI-->>User: "Flight results (text or JSON with query.passengers=2)"Comments Outside Diff (1)
fli/cli/commands/dates.py, line 441-473 (link)passengersmissing from error-path query dictsThe success path adds
"passengers": passengersto thequerydict, but the two inline fallback dicts built inside theParseErrorhandler (lines ~441–473) and theAttributeError/ValueErrorhandler (lines ~493–528) omit it. Any consumer inspecting the JSON error payload forquery.passengerswould getNone/KeyErroron a parse failure, inconsistent with the success response shape.The simplest fix is to include
"passengers": passengersin both inline error-path dicts, or (better) to always reference the already-constructedqueryvariable from line 299 the way theflightscommand does in_search_flights_core.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: add CLI passenger option and click ..." | Re-trigger Greptile