test(vehicle): cover BLE media commands over mocked transport - #53
Merged
Conversation
Bre77
force-pushed
the
fm/tfa-ble-pr6-media-v8
branch
from
July 9, 2026 11:16
1c0af0f to
6267027
Compare
added 4 commits
July 9, 2026 21:20
Regression tests for adjust_volume, media_volume_up/down, media_toggle_playback, media_next/prev_track, media_next/prev_fav, and remote_boombox (captain-present-only, mocked transport only). Live-verify against the test car is blocked tonight by BLE transport reliability (GATT write-response timeouts / error 133 on the proxy rig) - see the status file for evidence. Document the discovered media state-observability gap (Spotify leaves MediaState/MediaDetailState track fields empty) in AGENTS.md for the next live-verify attempt.
…finding Two further fresh-connection retries (per firstmate guidance) reproduced the same GATT write-response timeout on the first signed-command write; a same-session plain read succeeded immediately after. Car state reconfirmed unmutated. Not forcing further live attempts tonight - shipping the green mocked-transport suite and deferring live-verify pending a stable connection.
Bre77
force-pushed
the
fm/tfa-ble-pr6-media-v8
branch
from
July 9, 2026 11:20
6267027 to
e22c230
Compare
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
Live-verify the BLE media command group (PR-6 of the BLE production-readiness program): adjust_volume, media_volume_up/down, media_toggle_playback, media_next_track/media_prev_track, media_next_fav/media_prev_fav, all inherited Commands methods routed over VehicleBluetooth's BLE transport, exercised via a mocked-transport regression test per command asserting the correct signed VehicleAction proto is built and the OK reply decodes correctly. remote_boombox is intentionally CAPTAIN-PRESENT-ONLY (plays sound through the external speaker) so it is covered by a mocked-transport test only and was deliberately never actuated live, per standing safety policy for this program.
Live actuation against the real test car (VIN LRW3F7EK4NC716336, over an ESPHome BLE proxy at m5-btproxy.local) was attempted per the standard snapshot->act->verify->restore->confirm methodology used by the sibling PRs in this program. It was deferred, not completed: the first live write (adjust_volume) reliably hit a GATT write-response timeout (aioesphomeapi TimeoutAPIError) across 5 separate fresh connections/retries in one session (including retries explicitly requested by the supervising session after a fresh wake_up()), while plain BLE reads over the same connections succeeded normally every time. After every failed attempt the car's state was re-read and reconfirmed unchanged (audio_volume still 2.0, media_playback_status still Playing, nothing left mutated) - so this is a transport reliability issue, not a botched command. This asymmetry (writes fail, reads succeed) is recorded in AGENTS.md as a finding for whoever runs the next live-verify attempt on this rig, along with a separate, unrelated discovery that MediaState/MediaDetailState track-identity fields (artist/title/album/station) read empty on this car while Spotify is the active source, meaning media_next_track/prev_track/next_fav/prev_fav are not state-observable via those readers on this rig+source and should be verified by command ACK plus a paired restore call instead of an exact state match.
Given the deferred live-verify, this PR intentionally ships as tests-only (all 105 existing tests plus the new suite pass, ruff and pyright clean) with no behavior changes to any source file - only new test coverage and two AGENTS.md documentation notes. No commands were added or modified; VehicleBluetooth already inherits every one of these methods from the shared Commands ABC (this program's premise throughout: BLE work is verification, not implementation).
What Changed
VehicleActionpayloads and OK acknowledgement decoding for volume, playback, track/favorite navigation, andremote_boombox.docs/bluetooth_vehicles.md.Risk Assessment
✅ Low: The branch only adds mocked BLE media-command regression tests plus AGENTS.md notes, with no production source changes and no material review issues found.
Testing
Targeted mocked BLE media tests and the full 105-test suite passed; the generated JSON evidence shows each end-user media method call routed to
DOMAIN_INFOTAINMENT, the signedVehicleActiononeof/fields, and the decoded OK reply. I also cleaned transientuv/Python test artifacts from the worktree and left evidence only under/tmp/no-mistakes-evidence/01KX38YCWX7KDC7Q3G1XEHS68T.Evidence: BLE media command payload evidence
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_ble_mocked_media_commands.pyuv run pytest testspython - <<'PY' ...evidence generation attempt from repo root, which failed becausepythonwas not on PATHuv run python - <<'PY' ...evidence generation attempt fromtests/, which exposed and corrected a bad evidence-script assumption about a non-existent proto oneofuv run python - <<'PY' ...fromtests/to calladjust_volume,media_volume_up,media_volume_down,media_toggle_playback,media_next_track,media_prev_track,media_next_fav,media_prev_fav, andremote_boomboxthroughVehicleBluetoothmocked transport, decrypt the sent command, and write payload evidence✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.