You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reduce offscreen heartbeat frequency to avoid unnecessary service-worker wakeups #3241
Launch a browser with the Stagehand extension active.
Instrument the offscreen heartbeat's port.postMessage call with a counter.
Leave the browser idle for 60 seconds.
Observe approximately 60 heartbeat messages.
Proposed behavior
Increase the heartbeat interval from 1 second to 20 seconds. This would reduce scheduled heartbeat messages by 95%, to approximately three per minute, while leaving a nominal 10-second margin below Chrome's idle timeout.
The 20-second interval is a proposed implementation choice, not an interval prescribed by Chrome.
Validation
Confirm service-worker state survives at least 70 seconds of inactivity with the debugger detached and without polling the worker.
Verify recovery after heartbeat-port disconnection.
Preserve serialized offscreen-document creation.
Confirm the reduced frequency works across supported Chrome versions.
Hi — I'd like to take this heartbeat-frequency issue. I will verify the Chrome service-worker lifecycle assumptions, add a focused regression around the heartbeat interval and disconnected-port recovery, and run the extension tests. I will only adopt the 20-second interval if the lifecycle evidence supports it; otherwise I will report the measured boundary before changing behavior. I will use Codex and disclose the tooling in the PR. If someone is already working on it, please let me know.
Activity
Ethereal49 commentedon Oct 24, 2026
Hi — I'd like to take this heartbeat-frequency issue. I will verify the Chrome service-worker lifecycle assumptions, add a focused regression around the heartbeat interval and disconnected-port recovery, and run the extension tests. I will only adopt the 20-second interval if the lifecycle evidence supports it; otherwise I will report the measured boundary before changing behavior. I will use Codex and disclose the tooling in the PR. If someone is already working on it, please let me know.