Fix SMAppService helper so Performance Mode can control fans#6
Open
nsd97 wants to merge 3 commits into
Open
Conversation
Introduce PreviewSupport fixtures (no SMC/XPC in canvas), #Preview on every View, and a ChillMacTests target so previews and fixture contracts stay verifiable. Co-authored-by: Cursor <cursoragent@cursor.com>
Register the helper with BundleProgram and LaunchDaemons layout, gate Performance Mode on a live helper with an Install CTA, and extract testable PerformanceCurve/FanControlPolicy helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid @published dictionary churn that invalidates the popover mid-update when Performance Mode re-sends the same target. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes Performance Mode actually drive fans by fixing SMAppService daemon packaging (
BundleProgram+ LaunchDaemons embed), gating UI/control on a live helper, and only caching fan targets after successful XPC — closing the “UI lies while fans stay on auto” bug.Closes #4.
Context
Contents/Resources, SwiftUI popover monitor deferral (separate PR)What changed
FanControlHelper/Launchd.plist: addBundleProgram→Contents/Library/LaunchServices/com.idevtim.ChillMac.Helperproject.yml: copy plist intoContents/Library/LaunchDaemons/com.idevtim.ChillMac.Helper.plist; declare helper product as copy-script input (sandbox)helperReady/ Performance Mode on live helper readiness; Install Helper CTA + Login Items deep link when downFanControlPolicy+ extractPerformanceCurve(Low→Max only); only commit target caches after successful helper reply; skip no-op@Publishedoverride writesDocs vs forums (why readiness ≠
.enabledalone)Apple documents
SMAppService.Status.enabledas registered/eligible. Forum/DTS experience:.enabledis necessary but not sufficient — the daemon can be absent and XPC can fail. This PR gates on usable helper behavior and surfaces Install / Login Items when it is not.Review guide
Start at:
FanControlHelper/Launchd.plist→project.yml(LaunchDaemons copy) →ChillMac/Fan/FanControlPolicy.swift→ChillMac/App/main.swift/PopoverViewInstall CTA →HelperConnectionerror completionsHow to test
xcodegen generate && xcodebuild -project ChillMac.xcodeproj -scheme ChillMac -destination 'platform=macOS' testContents/Library/LaunchServices/(intentional SMJobBless-era path; not moved toContents/Resources)Checklist
xcodegen generate && xcodebuild -scheme ChillMac build)xcodebuild -project ChillMac.xcodeproj -scheme ChillMac -destination 'platform=macOS' test)Made with Cursor