Skip to content

Reduce polling: dash idle back-off 5/6/10 s, agent room poll 60 s - #57

Merged
ThinkOffApp merged 2 commits into
mainfrom
fix/dash-idle-backoff
Sep 15, 2026
Merged

ThinkOffApp merged 2 commits into
mainfrom
fix/dash-idle-backoff

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

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).

  1. Dash page idle back-off (carwatch/webchat.py): the 1 / 1.5 / 2 s self-polls (steer / voice / status) stay at those rates while OBD data is live, the steering value changes, voice is busy, or the screen is touched. After 60 s without any of that they run at 5 / 6 / 10 s; the first poll that sees a change flips back to fast, so a turned wheel or a started engine is noticed within one idle interval. Hidden tab: no polling.
  2. Agent room poll 20 s -> 60 s (carwatch/agent.py), CARWATCH_POLL_SECONDS env 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

ThinkOffApp and others added 2 commits September 15, 2026 20:11
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>
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
carwatch-dev Building Building Preview Sep 15, 2026 5:12pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T17:15:34.475474Z 643fa74 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread carwatch/agent.py
# 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"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@ThinkOffApp
ThinkOffApp merged commit 29657bb into main Sep 15, 2026
3 checks passed
@ThinkOffApp
ThinkOffApp deleted the fix/dash-idle-backoff branch September 15, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant