Skip to content

perf(agent-control): reduce proposal countdown churn#528

Open
beruro wants to merge 1 commit into
developfrom
perf/agent-control-countdown
Open

perf(agent-control): reduce proposal countdown churn#528
beruro wants to merge 1 commit into
developfrom
perf/agent-control-countdown

Conversation

@beruro

@beruro beruro commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace frame-rate countdown updates with a single one-second timer
  • pause countdown work while the window is hidden and recalculate from the absolute expiry time on foreground
  • own timer/listener teardown in a small scheduler with lifecycle regression tests

Performance guard

  • active/visible: at most one timer and one update per second
  • hidden: no timer remains armed
  • visible again: one immediate recalculation, then one timer
  • unmount/reopen: timer and listener are removed; every scheduler instance owns isolated state
  • failure/retry: not applicable; this path performs no I/O

Verdict: PASS. The change removes approximately 60 React updates per second from the five-minute proposal window and retains bounded O(1) state.

Verification

  • vitest run src/scaffold/GlobalSpotlight/palettes/AgentControlPalette/countdownScheduler.test.ts (3 tests)
  • tsc --noEmit
  • focused ESLint
  • Prettier check
  • git diff --check

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