You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: correct AGENTS.md lint, release and config-refusal entries; drop stale test map - #65
This PR updates AGENTS.md using the five worker sessions on this repository since 2026-10-03 (two releases, the listen_WallConnectorTotals feature, the per-door null guard, the CodeRabbit opt-in, and the streaming-allowance refusal fix). Each entry below was checked against the code at main. No code changes.
Removal: the "Test map" section. It maps areas to test file names, which ls tests/ and each file's docstring already show. It had also gone stale: 6 of the 21 test files were missing (test_active_route.py, test_charger_power.py, test_connect_failure_notifies.py, test_door_state_null.py, test_no_token_in_logs.py, test_tpms_warnings.py), and its test_listen_early_exit.py row said ERROR, but listen() logs a WARNING (stream.py). No session used it. Each session found its tests with ls or grep.
Removal (part of the energy_totals entry): the EnergyTotalsEvent field list, the date pass-through rationale and the 0-versus-None semantics of EnergyHistoryTotals. The EnergyHistoryTotals and listen_EnergyTotals docstrings already state these, and the README covers the same ground.
Addition: lint checks only teslemetry_stream/. tests/ has existing ruff errors, and ruff format is not enforced. Evidence: 3 sessions. Two ran ruff check over tests/, got errors in files they had not touched (for example test_field_type_coercion.py), and had to pick out their own errors before narrowing the command. The third found that ruff format --check fails on the committed vehicle.py and checked the parent commit to show that the failure was there before its change. Verified at main: ruff check tests reports 3 errors, and ruff format --check teslemetry_stream would reformat 5 files.
Addition (release entry): a release is its own PR that changes version in pyproject.toml and in the teslemetry-stream entry of uv.lock, with no changelog. The tag goes on that PR's merge commit. Evidence: 2 sessions (the 1.3.0 and 1.3.1 releases). Each grepped for the old version string to find where it lives, and the second rebuilt the steps from the previous bump commit.
Correction (vehicle config): the entry said that the pending config always survives a body-shaped error. Since the streaming-allowance change, _flush clears the pending config on streaming_allowance_exceeded and passes every body-shaped error to listen_config_refused callbacks. The session that made that change did not update this entry, so the entry no longer matched the code.
Correction (energy sites): the entry said to filter energy_totals on id and totals. wall_connector_totals now shares that envelope. A dispatched event carries no SSE topic name, so id and totals match both topics, and the two listeners tell them apart only by the totals keys (is_energy_totals() in const.py). Evidence: 1 session (the wall-connector feature) found that without this check listen_EnergyTotals would turn a wall-connector event into an all-NoneEnergyHistoryTotals. This is a correction of a wrong entry, not an addition from one incident.
No actionable comments were generated in the recent review.
Walkthrough
AGENTS.md updates test linting and release guidance. It also clarifies vehicle configuration refusal handling and revises energy totals guidance to cover two totals topics.
Changes: Agent guidance
Layer / File(s)
Summary
Test and release guidance AGENTS.md
The guidance now says to lint changed test files without reformatting untouched code. Release version changes are limited to pyproject.toml and the project entry in uv.lock, followed by tagging the merged release PR commit.
Vehicle configuration and energy totals guidance AGENTS.md
The guidance says body-shaped config errors go to every listen_config_refused callback and are not replayed. Pending config is retained except for streaming_allowance_exceeded, which clears it. Energy totals guidance now covers both totals topics and their shared envelope. It removes prior details about date interpretation, listener event types, and cumulative totals field values.
This documentation-only change introduces no established implementation or release risk and is ready to merge.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly describes the documentation updates to lint, release, and config-refusal guidance, as well as removal of stale test-map content.
Description check
The description directly explains the AGENTS.md updates, removed stale guidance, and corrected repository practices. It is detailed and related to the changeset.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CodeRabbit Verify
Run CodeRabbit Verify to test the changes in this pull request.
Reviewing files that changed from the base of the PR and between b2a5e17 and 87d59b6.
Files selected for processing: 1
AGENTS.md
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
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
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.
This PR updates AGENTS.md using the five worker sessions on this repository since 2026-10-03 (two releases, the
listen_WallConnectorTotalsfeature, the per-door null guard, the CodeRabbit opt-in, and the streaming-allowance refusal fix). Each entry below was checked against the code at main. No code changes.Removal: the "Test map" section. It maps areas to test file names, which
ls tests/and each file's docstring already show. It had also gone stale: 6 of the 21 test files were missing (test_active_route.py,test_charger_power.py,test_connect_failure_notifies.py,test_door_state_null.py,test_no_token_in_logs.py,test_tpms_warnings.py), and itstest_listen_early_exit.pyrow said ERROR, butlisten()logs a WARNING (stream.py). No session used it. Each session found its tests withlsorgrep.Removal (part of the
energy_totalsentry): theEnergyTotalsEventfield list, thedatepass-through rationale and the 0-versus-Nonesemantics ofEnergyHistoryTotals. TheEnergyHistoryTotalsandlisten_EnergyTotalsdocstrings already state these, and the README covers the same ground.Addition:
lintchecks onlyteslemetry_stream/.tests/has existing ruff errors, andruff formatis not enforced. Evidence: 3 sessions. Two ranruff checkovertests/, got errors in files they had not touched (for exampletest_field_type_coercion.py), and had to pick out their own errors before narrowing the command. The third found thatruff format --checkfails on the committedvehicle.pyand checked the parent commit to show that the failure was there before its change. Verified at main:ruff check testsreports 3 errors, andruff format --check teslemetry_streamwould reformat 5 files.Addition (release entry): a release is its own PR that changes
versioninpyproject.tomland in theteslemetry-streamentry ofuv.lock, with no changelog. The tag goes on that PR's merge commit. Evidence: 2 sessions (the 1.3.0 and 1.3.1 releases). Each grepped for the old version string to find where it lives, and the second rebuilt the steps from the previous bump commit.Correction (vehicle config): the entry said that the pending config always survives a body-shaped error. Since the streaming-allowance change,
_flushclears the pending config onstreaming_allowance_exceededand passes every body-shaped error tolisten_config_refusedcallbacks. The session that made that change did not update this entry, so the entry no longer matched the code.Correction (energy sites): the entry said to filter
energy_totalsonidandtotals.wall_connector_totalsnow shares that envelope. A dispatched event carries no SSE topic name, soidandtotalsmatch both topics, and the two listeners tell them apart only by thetotalskeys (is_energy_totals()inconst.py). Evidence: 1 session (the wall-connector feature) found that without this checklisten_EnergyTotalswould turn a wall-connector event into an all-NoneEnergyHistoryTotals. This is a correction of a wrong entry, not an addition from one incident.