fix(vehicle): align navigation_gps_request order default across transports#83
Merged
Conversation
added 2 commits
July 20, 2026 09:55
Cloud's order was optional (omitted -> null on the wire) while BLE's was a required int. Default both to 0 (REMOTE_NAV_TRIP_ORDER_UNKNOWN, a defined proto enum value) when the caller omits it, so cloud always sends an explicit order instead of null.
…to show order=0 default
Merged
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.
Intent
Align navigation_gps_request's order parameter across cloud (REST) and BLE transports per captain's ruling (2026-07-20): default an omitted order to 0 on both paths, rather than cloud omitting the field entirely while BLE required an int. Made order: int = 0 in both VehicleFleet.navigation_gps_request (fleet.py) and Commands.navigation_gps_request (commands.py). Verified 0 = REMOTE_NAV_TRIP_ORDER_UNKNOWN is a defined, valid proto enum value (proto/car_server.proto) safe on both transports' signed-command wire path - not a placeholder hack. Added cross-transport parity tests (tests/test_cross_transport_parity.py) asserting omitted order -> 0 on both cloud JSON payload and BLE protobuf message, and explicit order passes through unchanged. Updated AGENTS.md's cross-transport-parity note marking this divergence as resolved (previously listed as an open divergence pending decision). Full test suite, ruff, and pyright all pass.
What Changed
VehicleFleet.navigation_gps_request(fleet.py) andCommands.navigation_gps_request(commands.py) now both defaultorder: int = 0(REMOTE_NAV_TRIP_ORDER_UNKNOWN) when the caller omits it, replacing the prior mismatch where cloud omitted the field entirely (order: int | None = None) while BLE required a caller-supplied int.AGENTS.md's cross-transport-parity note to mark this divergence resolved (was previously listed as open/pending decision).NavigationGpsRequestParityTeststotests/test_cross_transport_parity.pyasserting an omittedorderresolves to0on both the cloud JSON payload and the BLE protobuf message, and that an explicitorderstill passes through unchanged.docs/bluetooth_vehicles.mdanddocs/fleet_api_signed_commands.mdto reflect the new default;uv.lockupdated incidentally.Risk Assessment
✅ Low: Small, well-bounded signature change (order: int = 0 on both transports) verified against the proto enum, with cross-transport parity tests covering both the default and explicit-order paths, and no other call sites depend on the old None/required signature.
Testing
Ran the new and full test suites (364 passed) and manually exercised VehicleFleet.navigation_gps_request in a live Python REPL to confirm the actual outgoing REST JSON payload now includes order: 0 when omitted (previously the field would be absent), matching the BLE side's protobuf default verified by the new parity tests; also confirmed proto enum value 0 (REMOTE_NAV_TRIP_ORDER_UNKNOWN) is a legitimately defined value, not a placeholder. No issues found.
Evidence: Cloud REST payload before/after order default (manual REPL check)
Evidence: New cross-transport parity tests for navigation_gps_request
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
uv run pytest tests/test_cross_transport_parity.py -v (6 passed, including the 2 new NavigationGpsRequestParityTests)uv run pytest tests (364 passed, full suite)Manual REPL check: called VehicleFleet.navigation_gps_request with order omitted and confirmed the outgoing _request json kwargs now contain order: 0 instead of omitting the key; called again with order=2 and confirmed pass-throughgrep proto/car_server.proto to confirm REMOTE_NAV_TRIP_ORDER_UNKNOWN = 0 is a defined enum value on both NavigationGpsRequest and its sibling message✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.