Repository navigation
Count a parked car's empty gear as the end of its drive - #756
Merged
Merged
Conversation
A Fleet read of a parked car reports no gear; P shows only while the car is in use. A read that came back after a drive with no gear never marked the drive's end, so the car stayed "leaving" and its policy limit waited for a plug-in a Fleet-only car may never be read for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
A Fleet API read of a parked car reports no gear (
shift_stateis null). The car reportsPonly while it is in use. Presence marked a drive's end only on astatechange or a gear ofP. So when a car drove off readingDand its next read came back home with no gear, the drive never ended: the car stayed "leaving", and its policy charge limit waited for a plug-in. A Fleet-only car may never be read after that plug-in, so the limit could wait indefinitely.This change counts an empty gear as parked when a moving car's read finds it home (
Presence.noteObservation). It is one condition inPresence.py, plus a regression test intest_command_path_parity.pythat replays the 2026-11-02 case: a Fleet-only car readsDas it leaves, then 20 minutes later reads home with no gear and is plugged in seconds later. The limit is set on that read with oneset_charge_limitcommand.Evidence: full unit suite (
pytest tests --ignore=tests/API --ignore=tests/integration --ignore=tests/scenarios): 2620 passed. Running on the live box since 2026-11-03.Changelog: none (the drive-end logic is not in a release yet)
🤖 Generated with Claude Code