Skip to content

fix(ui): reduce polling intervals to prevent progressive UI sluggishness#45930

Closed
McMuff86 wants to merge 2 commits into
openclaw:mainfrom
McMuff86:fix/ui-polling-intervals
Closed

fix(ui): reduce polling intervals to prevent progressive UI sluggishness#45930
McMuff86 wants to merge 2 commits into
openclaw:mainfrom
McMuff86:fix/ui-polling-intervals

Conversation

@McMuff86

Copy link
Copy Markdown

Problem

The Control UI polling intervals are very aggressive:

  • Nodes: every 5s
  • Logs: every 2s
  • Debug: every 3s

This causes excessive RPC traffic that leads to progressive dashboard slowdown — especially with many active sessions or when the dashboard is left open in a background tab.

Relates to #45698.

Changes

Reduced polling intervals to more reasonable defaults:

Poll Before After Rationale
Nodes 5s 30s Topology rarely changes
Logs 2s 5s Still near-realtime tail
Debug 3s 10s Status data is slow-moving

Also extracted magic numbers into named constants for maintainability.

Impact

  • ~85% reduction in polling RPC calls (from ~26/min combined to ~4/min)
  • No functional change — all polls still run, just less frequently
  • Logs tab remains responsive enough for live tailing
  • Nodes/Debug data is slow-moving enough that 30s/10s intervals are plenty

Testing

Verified on a local instance with 89 active sessions where the dashboard was noticeably sluggish before. After the change, CPU and network usage dropped significantly and the UI remained responsive.

Previous polling intervals (Nodes: 5s, Logs: 2s, Debug: 3s) caused
excessive RPC traffic that leads to progressive dashboard slowdown,
especially with many active sessions or when left open in a background
tab.

New intervals balance freshness with resource usage:
- Nodes:  30s (topology rarely changes)
- Logs:    5s (still near-realtime tail)
- Debug:  10s (status data is slow-moving)

Magic numbers replaced with named constants for maintainability.

Relates to openclaw#45698
@greptile-apps

greptile-apps Bot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces the polling frequencies for the three Control UI data feeds — nodes, logs, and debug — and extracts the previously inline magic numbers into named, documented constants. The changes are minimal, focused, and well-explained.

Key changes:

  • NODES_POLL_MS: 5 s → 30 s
  • LOGS_POLL_MS: 2 s → 5 s
  • DEBUG_POLL_MS: 3 s → 10 s
  • A JSDoc block documents the rationale for each interval directly above the constants

Observation (pre-existing, not introduced by this PR): startNodesPolling fires unconditionally on every tick regardless of the active tab, whereas startLogsPolling and startDebugPolling both guard behind a host.tab check before loading data. With the new 30-second interval this asymmetry is more visible — if the user is on a different tab, a stale nodes snapshot could be up to 30 s old when they switch back. A tab guard (or an immediate fetch on tab-switch) would eliminate that latency, but that's a follow-up concern rather than a blocker for this PR.

Confidence Score: 5/5

  • This PR is safe to merge — it is a purely numeric tweak with no logic changes and no risk of regression.
  • The diff touches a single file, replaces three hard-coded numeric literals with named constants, and does not alter any control flow. The new values are well-justified and the change is thoroughly documented inline.
  • No files require special attention.

Last reviewed commit: b3f5ae6

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

Copy link
Copy Markdown
Contributor

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: 34af89795d

ℹ️ 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 ui/src/ui/app-polling.ts
* - Debug: 10 s (status data is slow-moving)
*/
const NODES_POLL_MS = 30_000;
const LOGS_POLL_MS = 5_000;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Restore a shorter logs polling interval

Increasing LOGS_POLL_MS to 5 s makes the Logs tab lose data on busy gateways, not just update less often. The UI still requests only 500 lines / 250 KB per poll (ui/src/ui/app.ts:431-432), and logs.tail explicitly resets to the last maxBytes chunk whenever size - cursor > maxBytes (src/gateway/server-methods/logs.ts:81-91). That means any gateway emitting more than ~250 KB over 5 seconds will skip older lines between polls and show only the newest chunk. With the previous 2 s cadence the threshold was much higher, so this is a functional regression for live tailing sessions that generate lots of logs.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
Review failed before ClawSweeper could summarize the requested change.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Real behavior proof
Not applicable: Real behavior proof was not assessed because the Codex review failed.

Next step before merge
Review did not complete, so no work-lane recommendation was made.

Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

Do we have a high-confidence way to reproduce the issue?

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)

Remaining risk / open question:

  • No close action taken because the review did not complete.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 294844b42119.

BunsDev commented May 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer overlap triage after opening #75986:

This PR is related but not duplicate-closed or superseded by #75986. The scopes are different:

I would keep this PR deferred/needs-changes rather than close it as duplicate of #75986. The existing blockers still apply: preserve live log-tail semantics or restore the shorter logs cadence, and add the required changelog entry.

@BunsDev

BunsDev commented May 11, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #80657.

#80657 keeps the safe part of this proposal but narrows it to the evidence-backed churn path: Nodes polling is now scoped to the active Nodes tab with a slower active interval, pending session reload churn is debounced/cancelled, chat-side session refreshes are bounded, and eager node/device preloads are removed outside the Nodes flow. It intentionally does not slow Logs live-tail cadence while the Logs tab is active, so the log UX regression risk from this branch is avoided.

Verification on #80657 includes the focused polling/session tests and pnpm check:changed; the replacement branch also carries the active-version changelog entry.

@BunsDev BunsDev closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants