Files
orca/src/shared/plugins/workers
0173de9b52 fix(plugins): don't count time asleep as worker idle time (#28299)
* fix(plugins): don't count time asleep as worker idle time

The idle reaper measured idleness with the wall clock, so after a sleep longer than the reap window its first sweep reaped every worker before their own timers could fire. A sweep gap well past the 60s interval now starts a fresh idle window.

* fix(plugins): count a sleep before the first idle sweep as asleep, not idle

Start the reaper's sleep-detection clock when the first worker starts, so the
first sweep after waking can see the gap even if no sweep ran before the lid
closed.

* fix(plugins): keep worker manager under max-lines and restore real timers after sleep tests

Move the idle-candidate filter into PluginWorkerIdleClock so the rebased manager
stays within the 300-line lint cap, and reset fake timers after the idle-reap
tests so the sleep-before-first-sweep case does not leak them.

---------

Co-authored-by: petersindex <287557875+petersindex@users.noreply.github.com>
Co-authored-by: Neil <neil@stably.ai>
2026-11-07 03:19:46 -08:00
..