Skip to content

fix: handle missing psutil.cpu_freq() on Apple Silicon Macs#2

Open
johntrandall wants to merge 1 commit intoAshfaqbs:mainfrom
johntrandall:fix/apple-silicon-cpu-freq
Open

fix: handle missing psutil.cpu_freq() on Apple Silicon Macs#2
johntrandall wants to merge 1 commit intoAshfaqbs:mainfrom
johntrandall:fix/apple-silicon-cpu-freq

Conversation

@johntrandall
Copy link
Copy Markdown

Summary

  • psutil.cpu_freq() raises AttributeError on Apple Silicon (ARM64) Macs because CPU frequency scaling is not exposed on these chips
  • This crashes three tools: get_system_overview, get_power_settings, and diagnose_slow_performance
  • Wrapped all three call sites in try/except AttributeError, falling back to cpu_freq = None (which the existing if cpu_freq: guards already handle gracefully)

Test plan

  • Tested on Mac mini M2 (macOS 26.2, arm64, psutil 7.2.2)
  • All 18 tools pass after the fix (3 were previously crashing)
  • No behavioral change on systems where cpu_freq() works — the try/except only catches AttributeError

Generated with Claude Code

psutil.cpu_freq() raises AttributeError on Apple Silicon (ARM64) Macs
because CPU frequency scaling is not exposed on ARM chips. This crashes
three tools: get_system_overview, get_power_settings, and
diagnose_slow_performance.

Wrap all three call sites in try/except AttributeError, falling back to
cpu_freq = None (which the existing if-guards already handle).

Tested on Mac mini M2 (macOS 26.2, arm64, psutil 7.2.2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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