Skip to content

docs: correct energy_totals connect-time snapshot claim - #28

Merged
Bre77 merged 1 commit into
mainfrom
fm/pts-energy-totals-docstring
Aug 12, 2026
Merged

docs: correct energy_totals connect-time snapshot claim#28
Bre77 merged 1 commit into
mainfrom
fm/pts-energy-totals-docstring

Conversation

@Bre77

@Bre77 Bre77 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Intent

  • listen_EnergyTotals's docstring (and the matching AGENTS.md/CLAUDE.md note) claimed the server sends no snapshot on connect for energy_totals. It does - a connect-time snapshot arrives flagged isCache: true, same as live_status/site_info.
    • Fix: correct both the docstring and the project notes to describe the connect-time snapshot and what isCache means, while keeping the still-accurate parts (compact totals, not a full document; periodic-poll-only after that; silence between events isn't staleness).
  • Docs-only change, no behavior or test changes.

listen_EnergyTotals and AGENTS.md/CLAUDE.md claimed no snapshot is
sent on connect. The server does send one, flagged isCache: true.
@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 12, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

if not self.stream.connected:
return False
topics = self.stream.topics
return topics is None or SseTopic.CONFIG in topics

P2 Badge Treat mismatched VIN-scoped streams as stale

When a stream is constructed with vin=A, connect() subscribes only to /sse/A, but the public get_vehicle(B) method still creates a vehicle for B. Once that stream connects with the config topic enabled, this method reports B's record as live even though B's internal listener can never receive its config events; if B's cached record matches a requested field or prefer_typed value after the server changed it, the new no-op checks incorrectly skip the required PATCH. Include the stream's VIN scope in this liveness check, or reject mismatched get_vehicle() calls.

AGENTS.md reference: AGENTS.md:L19-L19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Bre77
Bre77 merged commit 199aad1 into main Aug 12, 2026
14 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