Skip to content

build(tesla): bump tesla-protocol floor to >=1.4.0 for protobuf 7 support - #140

Merged
Bre77 merged 3 commits into
mainfrom
fm/pytfa-release-protobuf7
Aug 31, 2026
Merged

build(tesla): bump tesla-protocol floor to >=1.4.0 for protobuf 7 support#140
Bre77 merged 3 commits into
mainfrom
fm/pytfa-release-protobuf7

Conversation

@Bre77

@Bre77 Bre77 commented Aug 31, 2026

Copy link
Copy Markdown
Member

Intent

Prepare the release of tesla-fleet-api carrying the protobuf-7-compatible tesla-protocol dependency. Raise the tesla-protocol floor to >=1.4.0 in pyproject.toml (tesla-protocol 1.4.0 declares protobuf>=6.32.0,<8, protobuf 7 compatible; this repo's protobuf>=6.32.0 floor is already unbounded above and stays as-is). Regenerate uv.lock so its root package version and tesla-protocol pin match. Ran the full test suite against tesla-protocol 1.4.0: 749 passed. Additionally spot-checked the test suite with protobuf 7.36.0 installed: 749 passed too, proving the protobuf-7 combination works, then restored the locked (protobuf 6.33.6) environment for the committed state. Bumped the package version (pyproject.toml version and tesla_fleet_api/init.py version) from 1.12.0 to 1.12.1 per the repo's own convention for a dependency-widening release (matching recent patch-bump release history). Fixed test breakage caused by the tesla-protocol 0.5.0 -> 1.4.0 jump: a protobuf field rename (NavigationSuperchargerRequest.order -> remote_nav_trip_order) required updating tesla_fleet_api/tesla/vehicle/commands.py's navigation_sc_request and its test; and new GetVehicleData substate fields caught by tests/test_proto_coverage_lock.py's coverage-lock test were resolved by wrapping four of them (vehicle_config, soh_state, vehicle_detail_state, display_state) as new BLE reader methods on VehicleBluetooth in tesla_fleet_api/tesla/vehicle/bluetooth.py following the existing reader pattern (e.g. alert_state()/parked_accessory_state()), while getLegacyVehicleState was added to the test's allowlist with a reason (ambiguous versus the existing legacy_vehicle_state()/getVehicleState reader, pending live verification) rather than wrapped. Updated docs/bluetooth_vehicles.md's BLE state reader list to include the four new readers, and AGENTS.md's cross-transport-parity note to reflect that navigation_sc_request's id param is no longer proto-absent (the proto gained an id field alongside the rename), just unwired. Deliver as a PR; do not push a release tag - intended tag is v1.12.1, stated in the PR description.

What Changed

  • Raised the tesla-protocol dependency floor to >=1.4.0 in pyproject.toml (from >=0.5.0) and regenerated uv.lock; bumped the package version from 1.12.0 to 1.12.1 in pyproject.toml and tesla_fleet_api/__init__.py.
  • Fixed a protobuf field rename in tesla_fleet_api/tesla/vehicle/commands.py's navigation_sc_request (NavigationSuperchargerRequest.orderremote_nav_trip_order) and updated the corresponding test in tests/test_ble_nav_misc_commands.py.
  • Wrapped four new GetVehicleData substate fields as VehicleBluetooth BLE reader methods (vehicle_config, soh_state, vehicle_detail_state, display_state) in tesla_fleet_api/tesla/vehicle/bluetooth.py, following the existing reader pattern, with matching coverage added to tests/test_ble_mocked_state_readers_new.py; added getLegacyVehicleState to tests/test_proto_coverage_lock.py's allowlist with a documented reason (ambiguous versus the existing legacy_vehicle_state()/getVehicleState reader).
  • Updated docs/bluetooth_vehicles.md's BLE state reader list to include the four new readers, and AGENTS.md's cross-transport-parity note to reflect that navigation_sc_request's id param is now proto-present but unwired (no longer proto-absent).

Intended release tag: v1.12.1 (not pushed by this PR).

Risk Assessment

✅ Low: The fix round correctly resolved both prior findings with genuine behavioral tests (verified against actual tesla_protocol field names) and a stale-doc update, matches the stated user intent (floor bump, version bump, field rename fix, four new BLE readers, coverage-lock allowlist, docs), and introduces no new issues.

Testing

Ran the targeted BLE/proto-coverage/cross-transport-parity tests plus a broader BLE-keyword sweep (431 total test cases across the two runs), all passing under the locked tesla-protocol==1.4.0/protobuf==6.33.6 environment; confirmed uv.lock/pyproject.toml/version-string consistency and that both previously-requested review fixes (new BLE reader tests, AGENTS.md floor note) are correctly present in the diff. No issues found.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed ✅
  • ⚠️ tesla_fleet_api/tesla/vehicle/bluetooth.py:1957 - The four new BLE reader methods (vehicle_config, soh_state, vehicle_detail_state, display_state) added to VehicleBluetooth have no behavioral test exercising them end-to-end. Sibling readers added under the same pattern (alert_state, parked_accessory_state) have dedicated tests in tests/test_ble_mocked_state_readers_new.py that build a VehicleData reply and assert the decoded result; these four have none — grepping the test suite for calls to any of the four methods returns nothing. The only thing that currently 'sees' them is tests/test_proto_coverage_lock.py's coverage-lock check, which just does a source-string match (field.name/type_name in BLUETOOTH_SOURCE) and cannot catch a wrong field wiring, since a typo'd reply-field access would still satisfy that check as long as the method text mentions the right names. Verified the field names used (vehicle_config/soh_state/vehicle_detail_state/display_state) do match VehicleData's actual descriptor fields, so there's no live bug today, but the new public surface ships with zero functional test coverage protecting it going forward.
  • ℹ️ AGENTS.md:112 - AGENTS.md line 112 ('Keep the tesla-protocol floor at >=0.5.0; earlier releases have generated .pyi imports that are incompatible with this repository's strict pyright checks.') was not updated even though this change raises the actual floor in pyproject.toml to >=1.4.0. The statement isn't factually contradicted (>=1.4.0 still satisfies >=0.5.0), but it's now stale guidance that undersells the current requirement and doesn't mention the protobuf-7/gencode-compatibility reason for the new floor documented elsewhere in this same PR (the Runtime-version pin paragraph two lines above it).

🔧 Fix: Add behavioral tests for 4 new BLE readers; fix stale AGENTS.md protocol-floor note
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • uv sync --locked (confirms uv.lock matches pyproject.toml's tesla-protocol>=1.4.0 floor and version 1.12.1)
  • uv run pytest tests/test_ble_mocked_state_readers_new.py tests/test_ble_nav_misc_commands.py tests/test_proto_coverage_lock.py tests/test_cross_transport_parity.py -v (37 passed) — exercises the 4 new BLE readers (vehicle_config, soh_state, vehicle_detail_state, display_state), the navigation_sc_request order->remote_nav_trip_order field rename, and the GetVehicleData coverage-lock allowlist update
  • uv run pytest tests/ -k &#39;ble or bluetooth or proto_coverage&#39; -q (394 passed, 8 subtests) — broader BLE regression sweep for the shared bluetooth.py/commands.py import changes
  • manual diff review of AGENTS.md and docs/bluetooth_vehicles.md against the two recorded review-fix decisions
  • manual check of installed tesla-protocol/protobuf versions in the locked venv (1.4.0 / 6.33.6) against the intent's stated committed state
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Bre77 added 3 commits August 31, 2026 21:27
tesla-protocol 1.4.0 declares protobuf>=6.32.0,<8, unblocking dependents
that need to move to protobuf 7 (Home Assistant's protobuf pin included).
The proto bump renamed NavigationSuperchargerRequest.order to
remote_nav_trip_order and added four new GetVehicleData substates
(vehicle_config, soh_state, vehicle_detail_state, display_state), now
wrapped as BLE readers; a fifth (getLegacyVehicleState) is allowlisted
pending live verification of how it differs from the existing
legacy_vehicle_state() reader.

Version bumped to 1.12.1 per the repo's dependency-widening convention.
@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 31, 2026
@Bre77
Bre77 merged commit 59f213d into main Aug 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant