Reduce polling: dash idle back-off 5/6/10 s, agent room poll 60 s - #57
Conversation
petrus, 15 Sep 2026: the VTA sat at 80 C with fans up for four hours on the desk. Measured on the box: chrome + cage (the dash kiosk) held one full core, GPU 0 %, llama-server idle; the page repainted on its own 1 / 1.5 / 2 s timers all day. Now: fast rates while OBD data is live, the wheel value changes, voice is busy, or the screen is touched; after 60 s without any of that the same polls run at 5 / 6 / 10 s, and the first poll that sees a change flips back to fast. Hidden tab: no polling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…override petrus, 15 Sep 2026: reduce unnecessary polling; hosting bills per request. 20 s was 4,320 room reads a day per box for an agent that answers in minutes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 643fa74548
ℹ️ 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".
| # 60 s (was 20). petrus, 15 Sep 2026: "make the changes immediately to reduce | ||
| # unnecessary polling"; hosting bills per request and this loop alone was | ||
| # 4,320 room reads a day per box. Override with CARWATCH_POLL_SECONDS. | ||
| POLL_SECONDS = int(os.environ.get("CARWATCH_POLL_SECONDS", "60")) |
There was a problem hiding this comment.
Paginate before lengthening the polling interval
With the room-agent default raised to 60 seconds, a room receiving more than 20 messages between reads silently loses messages: _fetch_messages() requests only the newest 20 (carwatch/agent.py:125-129, with newest-first semantics documented in carwatch/room.py:59-66), and the loop advances last_seen through that truncated subset (carwatch/agent.py:500-505). For example, if 21 messages arrive during one interval, the oldest—including an addressed text or voice note—is never observed on a later poll. Paginate from last_seen or enlarge/couple the fetch window before slowing the poll.
Useful? React with 👍 / 👎.
petrus, 15 Sep 2026: "please make the changes immediately to reduce unnecessary polling", after the VTA sat at 80 C for four hours with the dash kiosk holding one full core (chrome + cage, GPU 0 %, llama-server idle).
CARWATCH_POLL_SECONDSenv override. 4,320 -> 1,440 GroupMind requests a day per box.Verified: py_compile on both files; the dash script only moves the three timer lines into a scheduler and adds three one-line activity hooks. Box-side measurement (VTA temperature before/after) posted in the room.
🤖 Generated with Claude Code