Repository navigation
fix(server): stop the "Machine overloaded" warning while the CPUs sit idle - #45337
SimonLiu423 wants to merge 3 commits into
Conversation
… idle Without Linux PSI the CPU level came from the load average alone, which stays high on a swapping Mac with idle cores. Grade the load average only while the host CPUs are nearly all busy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — CPU overload warnings now account for actual CPU idle time when Linux PSI is unavailable, reducing misleading warnings during memory or disk waits. The change is confined to advisory telemetry and preserves existing stale-sample safeguards. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On my Mac the sidebar said "Machine overloaded: Work waits for a free CPU most of the time", while Activity Monitor showed the CPU about 80% idle. Without Linux PSI, the CPU level came only from the 1-minute load average per core (severe at 3, held until 1.2). A Mac that is swapping keeps load around 9.6 on 8 cores while the cores sit 85% idle, so the warning fired and stayed up. The real bottleneck was memory.
Now the load average counts as CPU overload only while the host CPUs are nearly all busy: under 10% idle to enter a level, under 25% to hold it, using the same hysteresis as the other levels. Idle time comes from
os.cpus()deltas between pressure samples. When idle is unknown (first sample, or stale), the previous level stays and the sample counts as unread, so a warning can't outlive its data.Follow-up: this removes the wrong CPU warning but adds no memory warning; #45344 tracks warning when macOS memory paging slows agents.
Proof: new grading rows and a macOS layer test fail on
mainand pass here;vp run check:changedpasses. On my Mac (load 12.4 on 8 cores, 43% idle), the old rule keptsevereand the new rule readsnone.Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code); reviewed by gpt-6.2-sol in Codex.
🤖 Generated with Claude Code